Documentation
¶
Overview ¶
Package glicko2 implements the Glicko 2 ranking system. It defines a method which can compute the ranking of a player, given plays against opponents for a tournament.
The code follows the Glicko2 paper quite precisely, except that it uses Ridder's method for finding roots. It does a bit of allocation, but in my tests it is by far the fastest code among solutions in Erlang, Go and OCaml. There are numerous places of low-hanging fruit, should the code prove to run too slowly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rank ¶
Rank ranks a player given a list of opponents. In order to rank a player, you must supply the rating r, the rating deviance rd and the volatility, sigma (σ). You must also supply a list of opponents as a []Opponent. And you must supply the configuration parameter tau (τ) Good values of tau are between 0.3 and 1.2. You will have to tune your data set to find a good tau by running a prediction algorithm. The function returns three values, nr, nrd, nsigma for the new rating, rating deviation and sigma/volatility value respectively.
Types ¶
type Opponent ¶
The Opponent interface is used to define opponents in a tournament. It is given as a slice to the ranker and every element in the slice is treated as a game that was played in the tournament. The interface must return the rating via R(); the rating deviance via RD() and the current σ value via Sigma(). The value SJ() encodes the outcome of the match. If the player for which we rank won the match, return 1.0. If the player lost, return 0.0. If the match was a draw, return 0.5. Note that Glicko2 is not really strong and handling draws.