Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Rough approximation Re: ELO Calculations

Author: Odd Gunnar Malin

Date: 14:35:40 04/19/05

Go up one level in this thread


On April 19, 2005 at 16:07:33, Dieter Buerssner wrote:

>On April 19, 2005 at 03:27:48, Odd Gunnar Malin wrote:
>
>>  // Alghorithm from Simon Schmitt's site on the net.
>>
>>  // Die offiziellen Elo-Zahlen werden nach folgender Formel errechnet:
>>  //  Erwartung = 0,5 + 1,4217 x 10^-3  x D
>>  //              - 2,4336 x 10^-7  x D x |D|
>>  //              - 2,5140 x 10^-9  x D x |D|^2
>>  //              + 1,9910 x 10^-12 x D x |D|^3
>>
>>  // wobei gilt:
>>  //  D   = Differenz = Elo(eigene, alt) - Elo(Gegner, alt)
>>  //  |D| = Absolutbetrag von D
>
>Interesting. I tried to reproduce the tables given by FIDE and the German chess
>federation, and got very close results to the numbers given. However in the
>tails, the error was larger than just a rounding error. I had tried formulas
>based on the logistic distribution (they were given earlier in this thread,
>too), and based on normal distribution. Both ´formulas give very similar
>numbers, unless in the extreme tails of the distribution. The numbers listed in
>the tables were somewhere in between ...
>
>Above formula looks like the author had a pocket calculator without scientific
>functions, and neither had a logarithmic table book, nor a (good) slide rule :-)
>
>Well, above formula can be calculated with a pen only in reasonable time. It may
>also be the case, that he really wanted the normal distribution. The formula for
>the score uses the error function erf() then, which really will not be on a
>slide rule. I think it could not easily be inverted for calculation of D.
>
>Regards,
>Dieter

You are probably right, what I eventually will end up with is a handcalculated
table. But this approx is closer to what you see used at Twic etc. than using
the log10 approx.

Here is how I do it now (in real it is in a c++ class):

int expectedscore[757];

void init()
{
  // Initialise the expectedscore table
  // This table gives elodifferance from score/game points 0.500 to 0.999
  // where ratigndiff at 0 are put in cell 0, ratingdif at 1 are put in cell 1
etc.
  // Only positive elo diferances are put in the table.

  // Alghorithm from Simon Schmitt's site on the net.
  // http://www.terminus-notfallmedizin.de/privat/daselosystem.html

  // Die offiziellen Elo-Zahlen werden nach folgender Formel errechnet:
  //  Erwartung = 0,5 + 1,4217 x 10^-3  x D
  //              - 2,4336 x 10^-7  x D x |D|
  //              - 2,5140 x 10^-9  x D x |D|^2
  //              + 1,9910 x 10^-12 x D x |D|^3

  // wobei gilt:
  //  D   = Differenz = Elo(eigene, alt) - Elo(Gegner, alt)
  //  |D| = Absolutbetrag von D
  int diff;
  long double score;
  long double c1,c2,c3,c4;
  c1=0.0014217;
  c2=0.00000024336;
  c3=0.0000000025140;
  c4=0.0000000000019910;
  expectedscore[0]=500;
  for (diff=1;diff<757;diff++)
  {
    score=0.5;
    score+=c1*diff;
    score-=c2*diff*diff;
    score-=c3*diff*diff*diff;
    score+=c4*diff*diff*diff*diff;
    expectedscore[diff]=(int)(score*1000+0.5);
  }
};

// To get the actual performance use:
// perf=average+ratingdiff
int getRatingDifferance(double score)
{
  bool negative=false;
  if (score<0.5)
  {
    score=1.0-score;
    negative=true;
  }
  int nscore=(int)((score+0.0005)*1000);
  int diff;
  for (diff=0;diff<757;diff++)
  {
    if (nscore<=expectedscore[diff])
      break;
  }

  if (negative)
    diff*=-1;
  return diff;
}

// ratingdiff=your rating - average rating
double getExpectedScore(int ratingdiff)
{
  bool negative=false;
  if (ratingdiff<0)
  {
    ratingdiff*=-1;
    negative=true;
  }
  double score=1.0;
  if (ratingdiff<757)
    score=(double)expectedscore[ratingdiff]/1000;
  if (negative)
    score=1.0-score;
  return score;
}

As you see I use a table lookup to get both expected score and performance
difference. It is only a table of 757 entries so it's easy to create it by hand
and put it in a header file. I would probably do this when I get time.

Odd Gunnar



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.