elo.prob: Elo probability

View source: R/elo.prob.R

elo.probR Documentation

Elo probability

Description

Calculate the probability that team A beats team B. This is vectorized.

Usage

elo.prob(elo.A, ...)

## Default S3 method:
elo.prob(elo.A, elo.B, ..., elos = NULL, adjust.A = 0, adjust.B = 0)

## S3 method for class 'formula'
elo.prob(formula, data, na.action, subset, ..., elos = NULL)

## S3 method for class 'elo.multiteam.matrix'
elo.prob(elo.A, ..., elos = NULL)

Arguments

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 formula or elo.A and elo.B.

adjust.A, 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.

Details

Note that formula can be missing the wins.A component. If present, it's ignored by elo.model.frame.

Value

A vector of Elo probabilities.

See Also

elo.update, elo.calc, elo.model.frame

Examples

elo.prob(1500, 1500)
elo.prob(c(1500, 1500), c(1500, 1600))

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)

## Also works to include the wins and k:
elo.prob(wins.A ~ elo.A + elo.B + k(k), data = dat)

## Also allows teams
elo.prob(c("A", "B"), c("C", "C"), elos = c(A = 1500, B = 1600, C = 1500))


elo documentation built on Aug. 23, 2023, 5:10 p.m.