Description Usage Arguments Details Value Players References Examples
Functions to compute rating and ranking using Elo method.
1 2 3 4 5 6 7 8 9  rate_elo(cr_data, K = 30, ksi = 400, initial_ratings = 0)
rank_elo(cr_data, K = 30, ksi = 400, initial_ratings = 0,
keep_rating = FALSE, ties = c("average", "first", "last", "random", "max",
"min"), round_digits = 7)
add_elo_ratings(cr_data, K = 30, ksi = 400, initial_ratings = 0)
elo(rating1, score1, rating2, score2, K = 30, ksi = 400)

cr_data 
Competition results in format ready for as_longcr(). 
K 
Kfactor for Elo formula. 
ksi 
Normalization coefficient for Elo formula. 
initial_ratings 
Initial ratings (see Iterative ratings). 
keep_rating 
Whether to keep rating column in ranking output. 
ties 
Value for 
round_digits 
Value for 
rating1 
Rating of player1 before the game. 
score1 
Score of player1 in the game. 
rating2 
Rating of player2 before the game. 
score2 
Score of player2 in the game. 
rate_elo()
and add_elo_ratings()
are wrappers for
rate_iterative()
and add_iterative_ratings()
correspondingly. Rate
function is based on Elo algorithm of updating ratings:
Probability of player1 (with rating r1) winning against player2 (with
rating r2) is computed based on rating difference and sigmoid function:
P = 1 / (1 + 10^( (r2  r1) / ksi ) )
. ksi
defines the spread of ratings.
Result of the game from player1 perspective is computed based on rule:
S = 1
(if score1
> score2
), S = 0.5
(if score1
== score2
) and
S = 0
(if score1
< score2
).
Rating delta is computed: d = K * (S  P)
. The more the K
the more the
delta (with other being equal).
New ratings are computed: r1_new = r1 + d
, r2_new = r2  d
.
elo()
function implements this algorithm. It is vectorized over all its
arguments with standard R recycling functionality. Note that not this
function is used in rate_elo()
and add_elo_ratings()
because of its not
appropriate output format, but rather its nonvectorized reimplementation is.
Ratings are computed based only on games between players of interest (see
Players) and NA
values.
rate_elo()
returns a tibble with columns
player
(player identifier) and rating_elo
(Elo
ratings, based on row order, by the end of competition
results). Bigger value indicates better player performance.
rank_elo()
returns a tibble
with columns player
, rating_elo
(if
keep_rating = TRUE
) and ranking_elo
(Elo ranking
computed with round_rank()
).
add_elo_ratings()
returns a widecr form of cr_data
with four rating columns added:
rating1Before  Rating of player1 before the game.
rating2Before  Rating of player2 before the game.
rating1After  Rating of player1 after the game.
rating2After  Rating of player2 after the game.
elo()
always returns a matrix with two columns containing ratings after the
game. Rows represent games, columns  players.
comperank
offers a possibility to handle certain set of players. It is done
by having player
column (in longcr format) as factor
with levels specifying all players of interest. In case of factor the result
is returned only for players from its levels. Otherwise  for all present
players.
Wikipedia page for Elo rating system.
1 2 3 4 5 6 7 8 9 10 11 12 13 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.