## How to simulate a game outcome given Elo difference?

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
nionita
Posts: 157
Joined: Fri Oct 22, 2010 7:47 pm
Location: Austria

### How to simulate a game outcome given Elo difference?

Can I do it in 2 steps, like considering draw probability constant, and then using Elo formula to "predict" the result, then take that as a probability for the stronger engine to win?

The problem with this approach is that the draw probability also depends on the Elo difference, at least when this is far from 0...

Laskos
Posts: 8963
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

### Re: How to simulate a game outcome given Elo difference?

nionita wrote:Can I do it in 2 steps, like considering draw probability constant, and then using Elo formula to "predict" the result, then take that as a probability for the stronger engine to win?

The problem with this approach is that the draw probability also depends on the Elo difference, at least when this is far from 0...
First, use logistic for score <---> Elo, the evidence supports that. Second, it's plausible that in (computer) Chess the draws obey Davidson model ---> draw_probab**2 = C*loss_probab*win_probab. You will not find agreement with Bayeselo, which uses Rao-Kupper ---> draw_probab**1 = C*loss_probab*win_probab, but it was shown empirically that Rao-Kupper doesn't suit well computer Chess. Use Ordo for ratings, as it uses Davidson.

nionita
Posts: 157
Joined: Fri Oct 22, 2010 7:47 pm
Location: Austria

### Re: How to simulate a game outcome given Elo difference?

Laskos wrote:
nionita wrote:Can I do it in 2 steps, like considering draw probability constant, and then using Elo formula to "predict" the result, then take that as a probability for the stronger engine to win?

The problem with this approach is that the draw probability also depends on the Elo difference, at least when this is far from 0...
First, use logistic for score <---> Elo, the evidence supports that. Second, it's plausible that in (computer) Chess the draws obey Davidson model ---> draw_probab**2 = C*loss_probab*win_probab. You will not find agreement with Bayeselo, which uses Rao-Kupper ---> draw_probab**1 = C*loss_probab*win_probab, but it was shown empirically that Rao-Kupper doesn't suit well computer Chess. Use Ordo for ratings, as it uses Davidson.
Thanks Kai.

I came up with the equations:

d = 2 * e - 2 * w
d * d = C * w * (1 - w - d)

where w, d are probabilities to win, respective draw,
e is the expectation result (score given Elo difference), and
C is a constant which has to be somehow determined (do you have values?)

At the end the final equation for win probability is:

(4-C)*w*w + (2*C*e - 8*e - C)*w + 4*e*e = 0

I wondered is I can find conditions for C so that this equation has always real solutions, at least one in (0, 1), for every e in (0, 1). But the calculations are complicated.

Laskos
Posts: 8963
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

### Re: How to simulate a game outcome given Elo difference?

nionita wrote:
Laskos wrote:
nionita wrote:Can I do it in 2 steps, like considering draw probability constant, and then using Elo formula to "predict" the result, then take that as a probability for the stronger engine to win?

The problem with this approach is that the draw probability also depends on the Elo difference, at least when this is far from 0...
First, use logistic for score <---> Elo, the evidence supports that. Second, it's plausible that in (computer) Chess the draws obey Davidson model ---> draw_probab**2 = C*loss_probab*win_probab. You will not find agreement with Bayeselo, which uses Rao-Kupper ---> draw_probab**1 = C*loss_probab*win_probab, but it was shown empirically that Rao-Kupper doesn't suit well computer Chess. Use Ordo for ratings, as it uses Davidson.
Thanks Kai.

I came up with the equations:

d = 2 * e - 2 * w
d * d = C * w * (1 - w - d)

where w, d are probabilities to win, respective draw,
e is the expectation result (score given Elo difference), and
C is a constant which has to be somehow determined (do you have values?)

At the end the final equation for win probability is:

(4-C)*w*w + (2*C*e - 8*e - C)*w + 4*e*e = 0

I wondered is I can find conditions for C so that this equation has always real solutions, at least one in (0, 1), for every e in (0, 1). But the calculations are complicated.
This solution for w:

w = (-C - 8*e + 2*C*e + sqrt[C] * sqrt[C + 16*e - 4*C*e - 16*e*e + 4*C*e*e]) / (2*[C-4])

has real results for w in (0,1) for every e in the interval (0,1) for any positive C. There is a second solution, but it gives weird results.

Empiric values for C are in units, say C=4 for reasonably matched engines at reasonable time controls. In fact the draw model is pretty crappy, as C depends on each engine pair and on strength (slowly increases with strength).

Ajedrecista
Posts: 1376
Joined: Wed Jul 13, 2011 7:04 pm
Location: Madrid, Spain.
Contact:

### Re: How to simulate a game outcome given Elo difference?

Hello:
nionita wrote:
Thanks Kai.

I came up with the equations:

d = 2 * e - 2 * w
d * d = C * w * (1 - w - d)

where w, d are probabilities to win, respective draw,
e is the expectation result (score given Elo difference), and
C is a constant which has to be somehow determined (do you have values?)

At the end the final equation for win probability is:

(4-C)*w*w + (2*C*e - 8*e - C)*w + 4*e*e = 0

I wondered is I can find conditions for C so that this equation has always real solutions, at least one in (0, 1), for every e in (0, 1). But the calculations are complicated.
I got the following:

Code: Select all

``````C = d²/&#91;w*&#40;1 - w - d&#41;&#93;

C = &#91;2*&#40;e - w&#41;&#93;²/&#123;w*&#91;1 - w - 2*&#40;e - w&#41;&#93;&#125;

C = 4*&#40;e² - 2*e*w + w²&#41;/&#40;w - 2*e*w + w²&#41;

C = 4*&#40;e² - 2*e*w + w² + w - w&#41;/&#40;w - 2*e*w + w²&#41;

C = 4*&#91;1 + &#40;e² - w&#41;/&#40;w - 2*e*w + w²&#41;&#93;

====================================
C = 4 + &#40;4/w&#41;*&#40;e² - w&#41;/&#40;1 - 2*e + w&#41;
====================================``````
I hope no typos. I did C = C(e, w) while Kai did w = w(e, C). It looks like I agree with Kai (C = 4 + ...). I wish you good luck.

Regards from Spain.

Ajedrecista.

Laskos
Posts: 8963
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

### Re: How to simulate a game outcome given Elo difference?

Ajedrecista wrote:Hello:
nionita wrote:
Thanks Kai.

I came up with the equations:

d = 2 * e - 2 * w
d * d = C * w * (1 - w - d)

where w, d are probabilities to win, respective draw,
e is the expectation result (score given Elo difference), and
C is a constant which has to be somehow determined (do you have values?)

At the end the final equation for win probability is:

(4-C)*w*w + (2*C*e - 8*e - C)*w + 4*e*e = 0

I wondered is I can find conditions for C so that this equation has always real solutions, at least one in (0, 1), for every e in (0, 1). But the calculations are complicated.
I got the following:

Code: Select all

``````C = d²/&#91;w*&#40;1 - w - d&#41;&#93;

C = &#91;2*&#40;e - w&#41;&#93;²/&#123;w*&#91;1 - w - 2*&#40;e - w&#41;&#93;&#125;

C = 4*&#40;e² - 2*e*w + w²&#41;/&#40;w - 2*e*w + w²&#41;

C = 4*&#40;e² - 2*e*w + w² + w - w&#41;/&#40;w - 2*e*w + w²&#41;

C = 4*&#91;1 + &#40;e² - w&#41;/&#40;w - 2*e*w + w²&#41;&#93;

====================================
C = 4 + &#40;4/w&#41;*&#40;e² - w&#41;/&#40;1 - 2*e + w&#41;
====================================``````
I hope no typos. I did C = C(e, w) while Kai did w = w(e, C). It looks like I agree with Kai (C = 4 + ...). I wish you good luck.

Regards from Spain.

Ajedrecista.
We also have to restrict solutions to be squeezed between w=e (w is always smaller or equal to e) and w=2*e-1 (d is between 0 and 1), thus C might be restricted, but it turns out it's unbounded positive: Orange ---> solution to w(e,C).
Green ---> w=e
Blue ---> w=2*e-1

The solution never intersects boundaries, so C in unrestricted positive.

nionita
Posts: 157
Joined: Fri Oct 22, 2010 7:47 pm
Location: Austria

### Re: How to simulate a game outcome given Elo difference?

I think the correct approach is to determine C statistically and solve the equation for w (then d and l) given e, which comes from Elo difference.

Many thanks, I needed it to test an algorithm for parameter optimization, and before I try long chess matches I wanted to be sure it works well on some known functions, where I consider the function value as Elo difference.