Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of expected outcome/win probability (possibly unused code discussion) #73

Open
shinuito opened this issue Dec 9, 2024 · 4 comments

Comments

@shinuito
Copy link

shinuito commented Dec 9, 2024

I'm sure if we use the win probability at all, but I did notice a while back that the code was updated and didn't match the frontend calculator code (which also wasn't being used anyway).

This came up in a discussion https://forums.online-go.com/t/basic-rank-maths-questions/46538/26?u=shinuito so I looked up whether there was a formula for such a win probability or expected outcome.

Just to be clear, this isn't the E that's being used in the ratings update steps - I think that's something else.

The specific E I'm mentioning is here:

E = 1 / (1 + exp(-g() * (self.rating + handicap_adjustment - white.rating) / GLICKO2_SCALE))

within the expected_win_probability function.

There is an example of the expected outcome of a game in the glicko paper http://www.glicko.net/glicko/glicko.pdf

but it's more like a quadratic sum, or that is, it's more like how standard deviations behave when two distributions are summed. So var(X+Y)=var(X)+var(Y), but
std(X+Y)=sqrt(Var(X+Y))=sqrt(var(X)+var(Y))=sqrt(std(X)^2+std(Y)^2) for uncorrelated random variables.

That gets passed into the computation of g() by the looks of it instead of

return 1 / sqrt(1 + (3 * white.phi ** 2) / (pi ** 2))

Just if we are looking to use this somewhere, or wanted to add it to the frontend calculator, as some people have previously requested, it might be useful to revisit this in discussion.

@anoek
Copy link
Member

anoek commented Dec 9, 2024

I haven't looked into this at all but just to note we use Glicko2 not the Glicko you're referencing: http://www.glicko.net/glicko/glicko2.pdf

@shinuito
Copy link
Author

shinuito commented Dec 9, 2024

I haven't looked into this at all but just to note we use Glicko2 not the Glicko you're referencing: http://www.glicko.net/glicko/glicko2.pdf

Sure, and that will of course change the rating scales and things like 400 in the above with the very random 173 everywhere.

I guess my point is that there is some proper notion of an expected outcome which depends on both players rating deviations RD (as it should right?). I'm not sure how you would factor in the volatilities for example if you want to include that.

Anyway it's just a hint that there might be a more proper notion of the win probability rather than just guessing it's the same E that shows up in the rating update step.

Animiral's comment https://forums.online-go.com/t/basic-rank-maths-questions/46538/23?u=shinuito

This function only considers this player’s rating deviation and disregards the opponent’s (white) deviation. This means that the result changes depending on which “side” you look from. i.e. p(A beats B) != 1 - p(B beats A).

is pointing out that it would be strange if it depended on only one player's rating deviation rather than both.

So, I would be interested in figuring out if the expected outcome from Glicko is also fine for Glicko2, or if there's a more appropriate notion, if anyone happens to be interested in it :)

@anoek
Copy link
Member

anoek commented Dec 9, 2024

@dexonsmith is any of this ringing a bell? The E line linked above was a change you had made when you were delving into all of this.

@dexonsmith
Copy link
Contributor

is pointing out that it would be strange if it depended on only one player's rating deviation rather than both.

Good point.

IIRC, I saw the E in Glicko2, which was the same label given to "expected win probability" in Glicko, and assumed it was correct for "expected win probability" in Glicko2. But it doesn't quite compute, as pointed out in the forum post.

So, I would be interested in figuring out if the expected outcome from Glicko is also fine for Glicko2, or if there's a more appropriate notion, if anyone happens to be interested in it :)

Please do look; the result would be interesting and useful. I just checked and expected_win_probability isn't used in the backend, but it is used for metrics in the goratings/ repo and we should get it right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants