glicko2 icon indicating copy to clipboard operation
glicko2 copied to clipboard

Expected result calculation?

Open DanMcInerney opened this issue 2 years ago • 6 comments

Can we get an expected result function?

DanMcInerney avatar Apr 23 '23 17:04 DanMcInerney

As in the changes in rating/rd or as in win/loss probability?

deepy avatar Apr 23 '23 18:04 deepy

Win/loss probability.

def expected_result(player_rating, opponent_rating, opponent_rd):
    q = math.log(10) / 400
    g = 1 / math.sqrt(1 + 3 * (q ** 2) * opponent_rd ** 2 / (math.pi ** 2))
    e = 1 / (1 + 10 ** (-g * (player_rating - opponent_rating) / 400))
    return e

On Sun, Apr 23, 2023 at 2:02 PM Alex Nordlund @.***> wrote:

As in the changes in rating/rd or as in win/loss probability?

— Reply to this email directly, view it on GitHub https://github.com/deepy/glicko2/issues/2#issuecomment-1519122393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN2ZJJZSAT7M7V6HZLPPXLXCVVBVANCNFSM6AAAAAAXIU7S6M . You are receiving this because you authored the thread.Message ID: @.***>

DanMcInerney avatar Apr 23 '23 18:04 DanMcInerney

Sounds good to me! I have another (unrelated) release I need to finish today and I've got a meeting on Monday but before Tuesday is over I should be able to get to it

deepy avatar Apr 23 '23 18:04 deepy

I should note I copied this code from ChatGPT. It looks right, but I can't read the mathematical notation in the wikipedia articles about how this is calculated and convert it to Python so you might want to double check it.

DanMcInerney avatar Apr 23 '23 18:04 DanMcInerney

Sounds good to me! I have another (unrelated) release I need to finish today and I've got a meeting on Monday but before Tuesday is over I should be able to get to it

is it in? Maybe close the issue if it is in.

mrkvicka22 avatar Aug 20 '23 20:08 mrkvicka22

Correct me if I'm wrong, but the expected result is the method _E, isn't it? But I agree that even if it is some nice wrapper would be nice.

srihak avatar Aug 27 '23 22:08 srihak