elo

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

james uselton

elo

Post by james uselton »

I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Dann Corbit
Posts: 12838
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: elo

Post by Dann Corbit »

james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
The meaning of Elo is that of a predictor.
The predictions are based on observations.
It takes about a thousand observations to form an accurate estimate.

If a computer chess engine plays 1000 games against you, it can say very accurately what the chances are of you scoring points over (say) a 100 game match against that same computer. It has no way possible to predict how you would do against Sergei Karjakin or against some other program.

If you would like to perform Elo calculations, there are many tools to do that. Be aware that rules differ somewhat as to the exact method to calculate Elo. For example: Fide, USCF and BCF ratings are not calculated in the exact same manner.

Here is a program to calculate Elo using the USCF algorithms:

Code: Select all

#include <stdio.h>
#include <math.h>
#include "uscf.h"

double          provisional_rating(
                                             double opponent_average_rating,
                                                   unsigned wins,
                                                   unsigned draws,
                                                   unsigned losses
)
{
    double          new_rating;
    if (wins + draws + losses == 0)
        new_rating = 0.;
    else
        new_rating = opponent_average_rating +
            (400.0 * ((wins + 0.5 * draws) - (0.5 * draws + losses)) /
             (wins + draws + losses));
    return (double) (unsigned) (new_rating + 0.5);
}
double          established_rating(
                                                   double old_rating,
                                                   double event_score,
                                                   double rating_difference,
                                                   char half_k_event,
                                                   double prize_amount,
                                                   unsigned event_level
)
{
    double          rating;
    double          k = old_rating >= 2400.0 ? 16.0 : old_rating >= 2100.0 ? 24.0 : 32.0;
    if (half_k_event)
        k *= 0.5;
    rating = old_rating + k * (event_score - win_expectancy(rating_difference));
    if (old_rating <= 2099.0 &&
        rating >= 2100.0 &&
        rating <= 2399.0)
        rating = 2100.0 + (rating - 2100.0) * 0.75;
    else if (old_rating >= 2100.0 &&
             old_rating <= 2399.0 &&
             rating <= 2099.0)
        rating = 2100.0 * (rating - 2100.0) * 1.33;
    else if (old_rating >= 2100.0 &&
             old_rating <= 2399.0 &&
             rating >= 2400.0 &&
             rating <= 3000.0)
        rating = 2400.0 * (rating - 2400.0) * 0.66;
    else if (old_rating >= 2400.0 &&
             old_rating <= 3000.0 &&
             rating >= 2100.0 &&
             rating <= 2399.0)
        rating = 2400.0 * (rating - 2400.0) * 1.50;
    return rating_floor_adj(old_rating, rating, prize_amount, event_level);
}
double          win_expectancy(
                                               double rating_difference
)
{
    return 1.0 / (pow(10.0, (rating_difference / 400.0)) + 1.);
}
double          rating_floor_adj(
                                                 double old_rating,
                                                 double new_rating,
                                                 double prize_amount,
                                                 unsigned event_level
)
{
    char            large_cash_prize = 0;
    double          temp_floor = old_rating - 200.0;
    unsigned        ltf = ((unsigned) (temp_floor)) % 100UL * 100UL;
    if (old_rating >= 2400 || old_rating <= 100)
        return new_rating;
    if (old_rating < 1600)
        ltf = 100;
    if (old_rating < 2200 && prize_amount >= 1000)
        large_cash_prize = 1;
    else if (old_rating < 2300 && prize_amount >= 1500)
        large_cash_prize = 1;
    else if (old_rating < 2400 && prize_amount >= 2000)
        large_cash_prize = 1;
    if (large_cash_prize)
        ltf = event_level;
    return ltf > new_rating ? (double) ltf : new_rating;
}
unsigned long   rating_floor(
                                             double old_rating,
                                             double new_rating,
                                             double prize_amount,
                                             unsigned event_level
)
{
    char            large_cash_prize = 0;
    unsigned        floor_value = (((unsigned) (old_rating - 200)) % 100U) * 100U;
    if (old_rating >= 2400 || old_rating <= 100)
        return (unsigned long) (new_rating + 0.5);
    if (old_rating < 1600)
        floor_value = 100;
    if (old_rating < 2200 && prize_amount >= 1000)
        large_cash_prize = 1;
    else if (old_rating < 2300 && prize_amount >= 1500)
        large_cash_prize = 1;
    else if (old_rating < 2400 && prize_amount >= 2000)
        large_cash_prize = 1;
    if (large_cash_prize)
        floor_value = event_level;
    return floor_value;
}
const char     *
                describe_uscf_rating(
                                                     unsigned rating
)
{
    char           *rating_name;
    if (rating > 2399)
        rating_name = "Senior Master";
    else if (rating >= 2200)
        rating_name = "Master";
    else if (rating >= 2000)
        rating_name = "Expert";
    else if (rating >= 1800)
        rating_name = "Class A";
    else if (rating >= 1600)
        rating_name = "Class B";
    else if (rating >= 1400)
        rating_name = "Class C";
    else if (rating >= 1200)
        rating_name = "Class D";
    else if (rating >= 1000)
        rating_name = "Class E";
    else if (rating >= 800)
        rating_name = "Class F";
    else if (rating >= 600)
        rating_name = "Class G";
    else if (rating >= 400)
        rating_name = "Class H";
    else if (rating >= 200)
        rating_name = "Class I";
    else
        rating_name = "Class J";
    return rating_name;
}
char            string[32767];
int             main(void)
{
    double          rating_difference;
    for (rating_difference = 0; rating_difference <= 3000; rating_difference += 100) {
        printf("Win expectency for a difference of %.0f points is %g\n", rating_difference,
               win_expectancy(rating_difference));
    }
    printf("%.15g\n", win_expectancy(60.0));
    puts("Elo difference:");
    fgets(string, sizeof string, stdin);
    rating_difference = atof(string);
    printf("Win expectency for a difference of %.0f points is %g\n", rating_difference,
           win_expectancy(rating_difference));

    return 0;
}
Marc MP

Re: elo

Post by Marc MP »

james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
Dann Corbit
Posts: 12838
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: elo

Post by Dann Corbit »

Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Marc MP

Re: elo

Post by Marc MP »

Dann Corbit wrote:
Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Hi Dan,

Are we speaking about the same thing? I'm not 100% sure I understood the poster question well, but it sound to me like he wants to have an evaluation (by elo) of its play for a *single* game. Like I played this game like a 1600 elo, and this other one like a 1900 elo etc..
Dann Corbit
Posts: 12838
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: elo

Post by Dann Corbit »

Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Hi Dan,

Are we speaking about the same thing? I'm not 100% sure I understood the poster question well, but it sound to me like he wants to have an evaluation (by elo) of its play for a *single* game. Like I played this game like a 1600 elo, and this other one like a 1900 elo etc..
Calculation of Elo from a single game is utter lunacy.
You *can* calculate a TPR from a small collection of games.
If a program proposed an Elo, based on a single game, I would lose all respect for that program (and I would cast a jaundiced eye at the programmer, but guess that he was simply ignorant of mathematics).
Marc MP

Re: elo

Post by Marc MP »

Dann Corbit wrote:
Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Hi Dan,

Are we speaking about the same thing? I'm not 100% sure I understood the poster question well, but it sound to me like he wants to have an evaluation (by elo) of its play for a *single* game. Like I played this game like a 1600 elo, and this other one like a 1900 elo etc..
Calculation of Elo from a single game is utter lunacy.
You *can* calculate a TPR from a small collection of games.
If a program proposed an Elo, based on a single game, I would lose all respect for that program (and I would cast a jaundiced eye at the programmer, but guess that he was simply ignorant of mathematics).
I'm aware an elo rating based on one game is not serious. I was just thinking of it as a "fun" (obviously it depends for whom!) feature.

In my opinion, based on more than ten years of OTB tournament playing, there would be a market for this. In almost any tournament I played in, a lesser player asked me: Did I played well in this game? Then we go through the game, do blunder check and I usually give a slightly optimistic assessment of his play!

I think that this (the assessment) could be done by an engine (unless you are a very strong chess player). I'm fairly sure that OTB tournament player would like to have such an assessment of their play (elo based) for one game or for a say, 5-games tournament.

As suspicious as it looks, "expert" assessment might give you a better idea about a player strenght than would a pure statistical answer, when the sample is very small.

Of course, if you can accumulate games a large amount of games (while the subject under obsevation doesnt improve or regress), go by the statistical analysis.

The way I understood the question was more about a (scientifically unproven yet!) feature, more than about a serious statiscal analysis of the results (yet I might be wrong - but if so I would suggest the idea to chess program/GUI programmers).
Dann Corbit
Posts: 12838
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: elo

Post by Dann Corbit »

Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Hi Dan,

Are we speaking about the same thing? I'm not 100% sure I understood the poster question well, but it sound to me like he wants to have an evaluation (by elo) of its play for a *single* game. Like I played this game like a 1600 elo, and this other one like a 1900 elo etc..
Calculation of Elo from a single game is utter lunacy.
You *can* calculate a TPR from a small collection of games.
If a program proposed an Elo, based on a single game, I would lose all respect for that program (and I would cast a jaundiced eye at the programmer, but guess that he was simply ignorant of mathematics).
I'm aware an elo rating based on one game is not serious. I was just thinking of it as a "fun" (obviously it depends for whom!) feature.

In my opinion, based on more than ten years of OTB tournament playing, there would be a market for this. In almost any tournament I played in, a lesser player asked me: Did I played well in this game? Then we go through the game, do blunder check and I usually give a slightly optimistic assessment of his play!

I think that this (the assessment) could be done by an engine (unless you are a very strong chess player). I'm fairly sure that OTB tournament player would like to have such an assessment of their play (elo based) for one game or for a say, 5-games tournament.

As suspicious as it looks, "expert" assessment might give you a better idea about a player strenght than would a pure statistical answer, when the sample is very small.

Of course, if you can accumulate games a large amount of games (while the subject under obsevation doesnt improve or regress), go by the statistical analysis.

The way I understood the question was more about a (scientifically unproven yet!) feature, more than about a serious statiscal analysis of the results (yet I might be wrong - but if so I would suggest the idea to chess program/GUI programmers).
I think that probably a lot of people would like it, the same as they like a program playing against them with "Morphy" or "Kasparov" personality.

It makes my stomach turn to think about it though (just like a program pretending that it plays like Capablanca).
Marc MP

Re: elo

Post by Marc MP »

Dann Corbit wrote:
Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
Dann Corbit wrote:
Marc MP wrote:
james uselton wrote:I was wondering why chess programs dont give you an approximate elo rating after each game? Is this too difficult to include in a program? Would it be too inaccurate? has it been tried in the past and found wanting?
Regards, Jim
Hi James,

Do you mean that the program would evaluate your elo based on a single game? Based on how well you played (tactical mistake etc?)?

If so, I'm not aware that has been done but I can see some "entertainement" value for the tournament player. You feed your games into the program, which goes on a carefull blunder check and then gives you a rating for that game, i.e. you played like a 1800elo player etc. We always want to know if we played well (in general). As engines are getting stronger and stronger (and hardware too), that seems like a real possibility.

That sounds to me as an interesting idea to implement in a full chess program/chess GUI.
ChessBase will calculate Elo for you.
Arena has a program included (elostat) to calculate Elo for you.

My opinion is that the best program for Elo calculation is BayesElo:
http://remi.coulom.free.fr/Bayesian-Elo/

The information by Royal C. Jones is a must read about Elo calculation:
http://www.ratingtheory.com/
Here is C code that performs the experiments of Roy Jones:
http://cap.connx.com/tournament_software/prog10.cpp
Hi Dan,

Are we speaking about the same thing? I'm not 100% sure I understood the poster question well, but it sound to me like he wants to have an evaluation (by elo) of its play for a *single* game. Like I played this game like a 1600 elo, and this other one like a 1900 elo etc..
Calculation of Elo from a single game is utter lunacy.
You *can* calculate a TPR from a small collection of games.
If a program proposed an Elo, based on a single game, I would lose all respect for that program (and I would cast a jaundiced eye at the programmer, but guess that he was simply ignorant of mathematics).
I'm aware an elo rating based on one game is not serious. I was just thinking of it as a "fun" (obviously it depends for whom!) feature.

In my opinion, based on more than ten years of OTB tournament playing, there would be a market for this. In almost any tournament I played in, a lesser player asked me: Did I played well in this game? Then we go through the game, do blunder check and I usually give a slightly optimistic assessment of his play!

I think that this (the assessment) could be done by an engine (unless you are a very strong chess player). I'm fairly sure that OTB tournament player would like to have such an assessment of their play (elo based) for one game or for a say, 5-games tournament.

As suspicious as it looks, "expert" assessment might give you a better idea about a player strenght than would a pure statistical answer, when the sample is very small.

Of course, if you can accumulate games a large amount of games (while the subject under obsevation doesnt improve or regress), go by the statistical analysis.

The way I understood the question was more about a (scientifically unproven yet!) feature, more than about a serious statiscal analysis of the results (yet I might be wrong - but if so I would suggest the idea to chess program/GUI programmers).
I think that probably a lot of people would like it, the same as they like a program playing against them with "Morphy" or "Kasparov" personality.

It makes my stomach turn to think about it though (just like a program pretending that it plays like Capablanca).
For the time being I feel about the same as you about the accurateness of such an evaluation (or personnality play as you point out). Yet, it is not impossible in my mind, that in the future this could be done in a relatively (as much as the moves of one single game permits to infer from them) accruate way. Time will tell if programmers are interested in doing this. For now I think they should give there attention about pawn play (chains, breakthrough etc.) so that it increases the "strategic" comprehension. But I'm obviously going off topic now.
Tony Thomas

Re: elo

Post by Tony Thomas »

From my understanding he is talking of a program that gives you an elo rating much like online chess servers. You start with a specific rating say 2000, and after each game your rating is updated. Calculating elo from a single game sounds kind of wild though..

Chessmaster already does that..