elo.run {elo} | R Documentation |
elo.run
Calculate Elos for a series of matches.
elo.run(formula, data, na.action, subset, k = NULL, initial.elos = NULL, ...) ## S3 method for class 'elo.run' print(x, ...) ## S3 method for class 'elo.run.regressed' print(x, ...)
formula |
A formula. See the help page for formulas for details. |
data |
A |
na.action |
A function which indicates what should happen when the data contain NAs. |
subset |
An optional vector specifying a subset of observations. |
k |
A constant k-value (or a vector, where appropriate). |
initial.elos |
An optional named vector containing initial Elo ratings for all teams in |
... |
Other arguments (not used at this time). |
x |
An object of class |
An object of class "elo.run"
or class "elo.run.regressed"
.
score
, elo.run.helperselo.run helpers, elo.calc
,
elo.update
, elo.prob
, elo.model.frame
.
data(tournament) elo.run(score(points.Home, points.Visitor) ~ team.Home + team.Visitor, data = tournament, k = 20) # Create non-constant 'k' elo.run(score(points.Home, points.Visitor) ~ team.Home + team.Visitor + k(20*log(abs(points.Home - points.Visitor) + 1)), data = tournament) # Adjust Elo for, e.g., home-field advantage elo.run(score(points.Home, points.Visitor) ~ adjust(team.Home, 30) + team.Visitor, data = tournament, k = 20) tournament$home.field <- 30 elo.run(score(points.Home, points.Visitor) ~ adjust(team.Home, home.field) + team.Visitor, data = tournament, k = 20) # Regress the Elos back toward 1500 at the end of the half-season elo.run(score(points.Home, points.Visitor) ~ adjust(team.Home, 30) + team.Visitor + regress(half, 1500, 0.2), data = tournament, k = 20)