Learn R Programming

EloRating (version 0.46.8)

likelo: (log) likelihood of Elo-rating model

Description

(log) likelihood of Elo-rating model

Usage

likelo(eloobject, daterange = NULL, burnin = NULL, ll = TRUE)

Arguments

eloobject

output from elo.seq

daterange

character or Date of length 2, gives the date range for which likelihood should be calculated. By default, the entire date range is considered.

burnin

not yet implemented

ll

logical, should the log likelihood be returned rather than the likelihood, by default TRUE

Value

numeric of length 1, the log likelihood

Details

This function returns the (log) likelihood of a dominance interaction sequence. The likelihood is the product of all winning probabilities (for each interaction).

References

franz2015aEloRating

mcmahan1984EloRating

Examples

Run this code
# NOT RUN {
data(adv)
res <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date, k = 200)
likelo(res)
res <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date, k = 100)
likelo(res)
ks <- seq(100, 400, by = 20)
liks <- numeric(length(ks))
for(i in 1:length(liks)) {
  liks[i] <- likelo(elo.seq(winner = adv$winner, loser = adv$loser,
                    Date = adv$Date, k = ks[i]))
}
plot(ks, liks, type = "l")
# }

Run the code above in your browser using DataLab