Bayesian Bradley-Terry
formula which specifies the model. RHS Allows only player
rating parameter and it should be specified in following manner:
rank | id ~ player(name).
rank player position in event.
id event identifier in which pairwise comparison is assessed.
player(name) name of the contestant. In this case player(name)
helps algorithm point name of the column where player names are stored.
Users can also specify formula in in different way:
rank | id ~ player(name|team). Which means that players are playing in teams,
and results are observed for teams not for players. For more see vignette.
data.frame which contains columns specified in formula, and
optional columns defined by lambda, weight.
named vector of initial players ratings estimates. If not specified
then r will be created automatically for parameters specified in formula
with initial value init_r.
rd named vector of initial rating deviation estimates. If not specified
then rd will be created automatically for parameters specified in formula
with initial value init_rd.
initial values for r if not provided.
Default (glicko = 1500, glicko2 = 1500, bbt = 25,
dbl = 0)
initial values for rd if not provided.
Default (glicko = 350, glicko2 = 350, bbt = 25/3, dbl = 1)
name of the column in data containing lambda values or one
constant value (eg. lambda = colname or lambda = 0.5).
Lambda impact prior variance, and uncertainty of the matchup result. The
higher lambda, the higher prior variance and more uncertain result of the
matchup. Higher lambda flattens chances of winning.
name of the column in data containing player share in team
efforts. It's used to first calculate combined rating of the team and
then redistribute ratings update back to players level. Warning - it should
be used only if formula is specified with players nested within teams (player(player|team)).
name of the column in data containing weights values or
one constant (eg. weight = colname or weight = 0.5).
Weights increasing (weight > 1) or decreasing (weight < 1) update change.
Higher weight increasing impact of event result on rating estimate.
controls rd shrinkage not to be greater than rd*(1 - kappa).
kappa=1 means that rd will not be decreased.
A "rating" object is returned:
final_r named vector containing players ratings.
final_rd named vector containing players ratings deviations.
r data.frame with evolution of the ratings and ratings deviations
estimated at each event.
pairs pairwise combinations of players in analysed events with
prior probability and result of a challenge.
class of the object.
method type of algorithm used.
settings arguments specified in function call.
# the simplest example
data <- data.frame(
id = c(1, 1, 1, 1),
team = c("A", "A", "B", "B"),
player = c("a", "b", "c", "d"),
rank_team = c(1, 1, 2, 2),
rank_player = c(3, 4, 1, 2)
)
bbt <- bbt_run(
data = data,
formula = rank_player | id ~ player(player),
r = setNames(c(25, 23.3, 25.83, 28.33), c("a", "b", "c", "d")),
rd = setNames(c(4.76, 0.71, 2.38, 7.14), c("a", "b", "c", "d"))
)
# nested matchup
bbt <- bbt_run(
data = data,
formula = rank_team | id ~ player(player | team)
)