glicko2: The Glicko-2 Rating System

Description Usage Arguments Details Value References See Also Examples

Description

Implements the Glicko-2 rating system for estimating the relative skill level of players in two-player games such as chess. It extends the Glicko method by including a volatility parameter for each player, representing the degree of expected fluctuation in the rating. Volatility is therefore a measure of consistency of performance.

Usage

1
2
glicko2(x, status = NULL, init = c(2200,300,0.15), gamma = 0, 
    tau = 1.2, history = FALSE, sort = TRUE, rdmax = 350, ...)

Arguments

x

A data frame containing four variables: (1) a numeric vector denoting the time period in which the game took place (2) a numeric or character identifier for player one (3) a numeric or character identifier for player two and (4) the result of the game expressed as a number, typically equal to one for a player one win, zero for a player two win and one half for a draw.

status

A data frame with the current status of the system. If not NULL, this needs to be a data frame in the form of the ratings component of the returned list, containing variables named Player, Rating, Deviation, Volatility, and optionally Games, Win, Draw, Loss and Lag, which are set to zero if not given.

init

The rating vector at which to initialize a new player not appearing in status. Must be a vector of length three giving the initial rating, initial deviation and initial volatility respectively. If different initializations for different players are required, this can be done using status. The initial deviation cannot be greater than rdmax. The initial volatility cannot be greater than rdmax divided by 400/log(10).

gamma

A player one advantage parameter; either a single value or a numeric vector equal to the number of rows in x. Positive values favour player one, while negative values favour player two. This could represent the advantage of playing at home, or the advantage of playing white for chess. Note that this is not passed to predict.rating, which has its own gamma parameter.

tau

The tau parameter, which controls the change in the player volatility across time. Smaller values prevent the volatility measures from changing by large amounts. Must be a single number. Mark Glickman suggests a value between 0.3 and 1.2. A non-positive value can be specified, in which case the volatilities are never updated.

history

If TRUE returns the entire history for each period in the component history of the returned list.

sort

If TRUE sort the results by rating (highest to lowest). If FALSE sort the results by player.

rdmax

The maximum value allowed for the rating deviation. The maximum value allowed for the volatility is rdmax divided by 400/log(10).

...

Not used.

Details

The Glicko-2 rating system is a method for evaluating the skill of players. It is more complex than Glicko because it includes a volatility for each player. It requires a single parameter optimization for each player within each time period. We use the R function optimize in preference to the root-finding approaches suggested in Glickman (2001) and Glickman (2013). Default values are roughly optimized for the chess data analyzed in the file doc/ChessRatings.pdf, using the binomial deviance criterion. A player one advantage parameter has been added to the original definition in the reference. A player one advantage parameter is also used for prediction purposes in predict.rating.

Value

A list object of class "rating" with the following components

ratings

A data frame of the results at the end of the final time period. The variables are self explanatory except for Lag, which represents the number of time periods since the player last played a game. This is equal to zero for players who played in the latest time period, and is also zero for players who have not yet played any games.

history

A three dimensional array, or NULL if history is FALSE. The row dimension is the players, the column dimension is the time periods. The third dimension gives different parameters.

gamma

The player one advantage parameter.

tau

The tau parameter.

type

The character string "Glicko-2".

References

Glickman, M.E. (2001) Dynamic paired comparison models with stochastic variances. Journal of Applied Statistics, 28, 673-689.

Glickman, M.E. (2013) Example of the Glicko-2 system.

See Also

elo, glicko, steph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
initstate <- data.frame(Player=1:4, Rating = c(1500,1400,1550,1700), 
  Deviation = c(200,30,100,300), Volatility = 0.06)
games <- data.frame(Week = 1, Payer1 = 1, Player2 = 2:4, Score = c(1,0,0))
robj <- glicko2(games, status = initstate, tau = 0.5, sort = FALSE)
print(robj, cols = 1:4, digits = 6)

afl <- aflodds[,c(2,3,4,7)]
robj <- glicko2(afl)
robj

robj <- glicko2(afl[afl$Week==1,])
for(i in 2:max(afl$Week)) robj <- glicko2(afl[afl$Week==i,], robj$ratings)
robj

Example output

Glicko-2 Ratings For 4 Players Playing 3 Games

  Player   Rating Deviation Volatility
1      1 1464.051 151.51652 0.05999583
2      2 1398.144  31.67021 0.05999909
3      3 1570.395  97.70917 0.05999940
4      4 1784.422 251.56556 0.05999897


Glicko-2 Ratings For 18 Players Playing 675 Games

                      Player Rating Deviation Volatility Games Win Draw Loss
1        Collingwood Magpies   2582    118.38     0.1469    88  68    2   18
2             Hawthorn Hawks   2395    109.45     0.1493    82  48    1   33
3               Geelong Cats   2393    116.79     0.1527    87  68    0   19
4          West Coast Eagles   2379    110.81     0.1515    81  39    0   42
5               Sydney Swans   2348    107.20     0.1506    82  44    1   37
6             Adelaide Crows   2279    109.35     0.1521    80  40    0   40
7           Essendon Bombers   2277    112.86     0.1549    80  37    2   41
8            St Kilda Saints   2216    107.21     0.1526    86  57    3   26
9            Richmond Tigers   2193    109.50     0.1510    78  25    2   51
10             Carlton Blues   2190    107.12     0.1499    82  45    1   36
11 North Melbourne Kangaroos   2171    112.11     0.1511    78  34    1   43
12         Fremantle Dockers   2154    109.32     0.1514    80  35    0   45
13          Western Bulldogs   2103    107.89     0.1477    84  45    0   39
14            Brisbane Lions   2067    115.37     0.1499    80  30    1   49
15       Port Adelaide Power   1998    112.95     0.1521    78  26    0   52
16          Melbourne Demons   1979    119.94     0.1501    78  22    2   54
17    Greater Western Sydney   1802    134.07     0.1489    12   1    0   11
18           Gold Coast Suns   1696    123.19     0.1478    34   3    0   31
   Lag
1    0
2    1
3    0
4    0
5    0
6    0
7    0
8    1
9    1
10   1
11   0
12   0
13   0
14   0
15   1
16   0
17   0
18   1


Glicko-2 Ratings For 18 Players Playing 675 Games

                      Player Rating Deviation Volatility Games Win Draw Loss
1        Collingwood Magpies   2582    118.38     0.1469    88  68    2   18
2             Hawthorn Hawks   2395    109.45     0.1493    82  48    1   33
3               Geelong Cats   2393    116.79     0.1527    87  68    0   19
4          West Coast Eagles   2379    110.81     0.1515    81  39    0   42
5               Sydney Swans   2348    107.20     0.1506    82  44    1   37
6             Adelaide Crows   2279    109.35     0.1521    80  40    0   40
7           Essendon Bombers   2277    112.86     0.1549    80  37    2   41
8            St Kilda Saints   2216    107.21     0.1526    86  57    3   26
9            Richmond Tigers   2193    109.50     0.1510    78  25    2   51
10             Carlton Blues   2190    107.12     0.1499    82  45    1   36
11 North Melbourne Kangaroos   2171    112.11     0.1511    78  34    1   43
12         Fremantle Dockers   2154    109.32     0.1514    80  35    0   45
13          Western Bulldogs   2103    107.89     0.1477    84  45    0   39
14            Brisbane Lions   2067    115.37     0.1499    80  30    1   49
15       Port Adelaide Power   1998    112.95     0.1521    78  26    0   52
16          Melbourne Demons   1979    119.94     0.1501    78  22    2   54
17    Greater Western Sydney   1802    134.07     0.1489    12   1    0   11
18           Gold Coast Suns   1696    123.19     0.1478    34   3    0   31
   Lag
1    0
2    1
3    0
4    0
5    0
6    0
7    0
8    1
9    1
10   1
11   0
12   0
13   0
14   0
15   1
16   0
17   0
18   1

PlayerRatings documentation built on March 1, 2020, 5:07 p.m.