Calculate the probability that team A beats team B. This is vectorized.
elo.prob(elo.A, ...) # S3 method for default elo.prob(elo.A, elo.B, ..., elos = NULL, adjust.A = 0, adjust.B = 0) # S3 method for formula elo.prob(formula, data, na.action, subset, ..., elos = NULL) # S3 method for elo.multiteam.matrix elo.prob(elo.A, ..., elos = NULL)
elo.A, elo.B | Numeric vectors of elo scores, or else vectors of teams. |
---|---|
... | Other arguments (not in use at this time). |
elos | An optional named vector containing Elo ratings for all teams in |
adjust.A | Numeric vectors to adjust |
adjust.B | Numeric vectors to adjust |
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. |
A vector of Elo probabilities.
Note that formula
can be missing the wins.A
component. If
present, it's ignored by elo.model.frame
.
elo.update
, elo.calc
,
elo.model.frame
elo.prob(1500, 1500) #> [1] 0.5 elo.prob(c(1500, 1500), c(1500, 1600)) #> [1] 0.500000 0.359935 dat <- data.frame(wins.A = c(1, 0), elo.A = c(1500, 1500), elo.B = c(1500, 1600), k = c(20, 20)) elo.prob(~ elo.A + elo.B, data = dat) #> [1] 0.500000 0.359935 ## Also works to include the wins and k: elo.prob(wins.A ~ elo.A + elo.B + k(k), data = dat) #> [1] 0.500000 0.359935 ## Also allows teams elo.prob(c("A", "B"), c("C", "C"), elos = c(A = 1500, B = 1600, C = 1500)) #> [1] 0.500000 0.640065