Help Needed concerning calculating rating changes

For discussion pertaining to Chess, Net-Chess, or general interests.
Post Reply
keithstuart
Uranium
Posts: 266
Joined: Mon Apr 12, 1999 3:52 am
Location: NW England
Contact:

Help Needed concerning calculating rating changes

Post by keithstuart » Mon Jul 12, 2004 10:43 am

Hi

Can anyone help me with the working out of rating changes after a game finishes??

Idealy a nice simple program would be perfect if one exists??

What i want to do is set up a rating list for a league that i am helping set up which is full of good players and people who play just for fun. We recently had a knockout tournament that i won and during it we sort of decided a league system should be setup. To assist the structure better i want to keep track of peoples ratings so you know if you are playing a good player or not.

Any help greatly appreciated

Keith

gmiller
Site Admin
Posts: 1388
Joined: Sun Mar 14, 1999 11:13 am
Location: Jeffersonville, IN
Contact:

Post by gmiller » Mon Jul 12, 2004 11:05 am

Here's the code I use, in Perl, it probably won't be that helpful to you unless you're into programming.

Code: Select all

sub rateplayer{
   my $self=shift;
   my $player=shift;
   my $orating=shift;
   my $score=shift;
   my ($rate,%rec,$d,$p,$newrating,$diff,$newfloor);
   local (*I);

   open(I,">>log/ratings.txt");

   %rec=$self->readrec($player);
   print I "$player\t$rec{rating}\t$orating\t$score\t$rec{provisional}\t";
   $rate=$rec{rating};
   $p=$rec{gamesplayed};
   if($p==0){$p++;}
   $rec{averating}=($orating+(($p-1)*$rec{averating}))/$p;

   if($rec{provisional} eq "y"){
      $p=($rec{gameswon}*2+$rec{gamesdrawn})/($p*2);
      if($p==0){
         $d=-400;
      } elsif($p==1) {
         $d=400;
      } else {
         $d=-200*((log((1-$p)/$p))/(log(10)));
      }
      if($rec{gamesplayed}>7){$newrating=$d+$rec{averating};}else{$newrating=$rec{rating};}
   } else {
      $diff=$rec{rating}-$orating;
      $p=1/(1+10**((-$diff)/400));
      $newrating=$rate+int(32*($score-($p)));
      $newfloor=int($newrating/100)*100-200;
      if($newfloor > $rec{ratingfloor}){$rec{ratingfloor}=$newfloor;}

      if($rec{nofloor} eq "y"){
         $rec{ratingfloor}=0;
      }
   
      if($newrating < $rec{ratingfloor}){$newrating=$rec{ratingfloor};}
      if($rec{ratingfloor}>2100){$rec{ratingfloor}=2100;}
   }
   $rec{rating}=int($newrating);
	if($rec{rating}>3000){$rec{rating}=3000;}
   print I "$rec{rating}\n";
   %{$self->{rec}}=%rec;
   $self->storerec();
}

keithstuart
Uranium
Posts: 266
Joined: Mon Apr 12, 1999 3:52 am
Location: NW England
Contact:

Post by keithstuart » Mon Jul 12, 2004 2:08 pm

thanks for that

might not be useful to me but i am sure some one can sort it out

i presume i can just punch in two ratings and get new ones dependant on match result?

knightmare
Uranium
Posts: 46
Joined: Mon Dec 06, 1999 10:56 pm

Post by knightmare » Mon Jul 12, 2004 6:54 pm

A google search for Chess rating calculator revealed about 30,000 hits!!
This one looked most promising
http://www.arizonachess.com/calculator.php


hope it helps

speartooth
Posts: 4
Joined: Tue May 18, 2004 5:28 pm

Post by speartooth » Tue Jul 13, 2004 12:58 am

Excel 97 spreadsheets http://dooley.m.tripod.com/ratings/templates.zip
are the result of another google search.

As I recall, tripod.com has aggressive ads and cookies :( . Be sure to pump up your web filter before you look there.

Ed

keithstuart
Uranium
Posts: 266
Joined: Mon Apr 12, 1999 3:52 am
Location: NW England
Contact:

Post by keithstuart » Tue Jul 13, 2004 11:17 am

knightmare wrote:A google search for Chess rating calculator revealed about 30,000 hits!!
This one looked most promising
http://www.arizonachess.com/calculator.php


hope it helps
Thanks for this one looks the easiest to use provided i can figure out what you are meant to enter as a score

Post Reply