# Chess Statistics How to?

I am a graduate student studying statistics and I play chess once in a while for fun.

I was thinking (just for the fun of it) -- applying some of what I've learned in statistics to chess games: I want to perform statistical analysis of chess games.

Note: My primary purpose is recreation:

1. Tinkering around
2. Re-producing earlier works -- for example how much of an advantage does white have over black
3. Looking at mid-game winning patterns
4. Etc. etc.

So to that:

1. I need a large collection of chess games (historic data)
2. I will then analyze them using R which is a statistical programming language

Question:

1. I'm looking a collection of games that I can then use as my data set (I would love to get a list of open source chess databases -- commercial chess database might have restrictions on em)
2. I'm looking for any reference material -- like seminal papers in this area.

Thanks.

• What do you want to analyze? There're lots of statistical algorithm and lots of areas that you can do it. – SmallChess Dec 1 '14 at 23:35

I started doing something similar some time ago. So I can give you some advice. As already stated by @Student T, you need to define precisely which is the question you want to answer with statistics. I will not repeat his argument which is complete enough, but let me just say that defining well your problem is essential to select your methods of analysis and the selection of data.

1. The dataset. If you are interested in analysing games, one good option might be the The Week In Chess database, which includes all the games of international competitions (= games of high-rated players). Another possibility is the million base, containing 2.2 million games. Whereas if you are interested in analysing ratings, you can download FIDE rating list here, for example. In downloading the dataset(s) you want to use, you should consider the following:

1.1. The format: chessbase format is proprietary, which means it is difficult to know which are its specifications and, in consequence, to extract the data. The format pgn is more convenient, you can process it as a textfile and extract the information you need using the pgn file specifications.

1.2. How to filter the data / which data to include in the database (in statistical parlance, sampling and stratification issues). For this you need to specify which is your population. Are you interested in games of high-rated players? Then, it is easy to find the games and databases include many. In contrast, it is more difficult to find games of unrated or lower-rated players, but you can find some of them in the websites of some national chess federations (Canada, Scotland, Wales, Ireland...). Also, there might be differences in the behaviour of chess players depending on the type of competition (individual or by teams; human, computer or correspondence games; etc.). Do you include all type of competitions or you leave out some of them?

1.3. Rating systems inhomogeneities. Chess rating systems are usually based on professor Arpad Elo rating system, but with different coefficient values. For example, USCF and FIDE ratings are not equivalent. And the value of coefficients can also change with time (see here for an example).

2. Some bibliography. I can hint you little reference material. Some time ago I did a quick search on Scopus and didn't find any interesting article (but you could try to dig deeper). However, some years ago I looked through a book on chess and mathematics. It dealt with geometrical, combinatorial and probability issues, but not with statistical analyses. It was originally written in German and there is also a translation to Spanish, but I don't think there is an English version. You can find some similar references in Wolfram MathWorld's Chess article. You might also be interested in this analysis of piece moving rate as a function of Elo rating. Regarding the rating system, the seminal work is professor Elo's book The rating of chessplayers, past and present.

• thanks for your answer, I've updated my question -- I'm basically looking to develop a toolkit which will allow me to tinker around for recreational purposes -- have updated the questions – user1172468 Dec 8 '14 at 18:52
• Another comment I'm looking for existing chess databases that are open source -- so if that is an important part of my question – user1172468 Dec 8 '14 at 18:53
• I have added some resources: a link to the million base database, links to some national federations pgn files, and a statistical analysis answering a question in chess stackexchange. If you want to tinker around, the 2,2 million games of the million base should be more than enough. On the other side, there is no copyright for chess games. It's the database format that is propietary or not. You can open the pgn files with a text editor to see how they are made. And it is easy (although somewhat tricky) to import the data into R (using the command readLines, for example). – lodebari Dec 8 '14 at 23:26

I'll leave others to point you a correct database for the games because I'll focus more on the statistical part.

First, you need to ask yourself what you want to analyze. If you don't know, you should really ask yourself what problem you want to address. Your question simply say "I want to do something, but I don't know what to do.". There're infinite ways how a database of chess games can be analyzed. I'll point to you for some areas.

1. Whether white has an advantage

Given a large data set, if we assume the games are independent we might strip away the draws. Then we might assume a binomial distribution with p=0.5 and try to detect statistical significance. However, this approach assumes that the players are equal.

1. There's rumor that Carlsen got most of his points from players older than him (last generation like Anand) but suffers against like Caruana and Giri. Is that true?

You might use a two samples-mean t-test or something like that.

1. Whether Elo rating is really inflated

2. Given a set of games between two players (or computers), is one player really better than another?

For example, Carlsen has beaten Nakamura many games without a loss. Does it mean Carlsen is a better player? Did that happen because Carlsen was simply lucky.

1. Correlation between world-number one and world champion

Is there a positive correlation? Are they independent?

1. Whether the Elo rating system really make sense

There were some articles on Chessbase about it a while ago. I don't remember the names so you'll need google yourself.

• thanks for your answer, I've updated my question -- I'm basically looking to develop a toolkit which will allow me to tinker around for recreational purposes -- have updated the questions – user1172468 Dec 8 '14 at 18:53

That's an unique thing that you are doing. However to help you, to collect most of all the games played by recognized rated players around the world, the below website will help you.

database.chessbase.com/

• @Paven Nadig thanks for your answer, I've updated my question -- I'm basically looking to develop a toolkit which will allow me to tinker around for recreational purposes -- have updated the questions – user1172468 Dec 8 '14 at 18:52
• this is a commercial database no? I'm looking for open source databases. Thanks. – user1172468 Dec 8 '14 at 18:54