Calculate the update value for a given Elo matchup. This is used in elo.calc, which reports the post-update Elo values. This is vectorized.

elo.update(wins.A, ...)

# S3 method for default
elo.update(wins.A, elo.A, elo.B, k, ..., adjust.A = 0, adjust.B = 0)

# S3 method for formula
elo.update(formula, data, na.action, subset, k = NULL, ...)

Arguments

wins.A

Numeric vector of wins by team A.

...

Other arguments (not in use at this time).

elo.A

Numeric vectors of elo scores.

elo.B

Numeric vectors of elo scores.

k

A constant k-value (or a vector, where appropriate).

adjust.A

Numeric vectors to adjust elo.A and elo.B by.

adjust.B

Numeric vectors to adjust elo.A and elo.B by.

formula

A formula. See the help page for formulas for details.

data

A data.frame in which to look for objects in formula.

na.action

A function which indicates what should happen when the data contain NAs.

subset

An optional vector specifying a subset of observations.

Value

A vector of Elo updates.

See also

elo.prob, elo.calc, elo.model.frame

Examples

elo.update(c(1, 0), c(1500, 1500), c(1500, 1600), k = 20)
#> [1] 10.0000 -7.1987

dat <- data.frame(wins.A = c(1, 0), elo.A = c(1500, 1500),
                  elo.B = c(1500, 1600), k = c(20, 20))
elo.update(wins.A ~ elo.A + elo.B + k(k), data = dat)
#> [1] 10.0000 -7.1987