eloratingfixed: Create daily elo ranks and multiple derivatives with...

Description Usage Arguments Details Value Examples

View source: R/eloratingfixed.R

Description

Conducts traditional elo rating analyses using specified K value and outputs raw, normalized, cardinal, and categorical ranks as a list object in R or in an output file. For optimized Elo parameters, use eloratingopt.

Usage

1
2
eloratingfixed(agon_data, pres_data, k = 100, init_elo = 1000, outputfile = NULL, 
  returnR = TRUE, p_function = "sigmoid")

Arguments

agon_data

Input data frame with dominance interactions, should only contain Date, Winner, Loser. Date should be formatted as MONTH/DAY/YEAR, or already as Date class.

pres_data

Input data frame with columns "id", "start_date" and "end_date". Date columns should be formatted as MONTH/DAY/YEAR, or already as Date class. If all IDs are present the whole time, you ignore this and a pres_data table will be automatically generated.

k

Specified value of the k parameter, default is 100

init_elo

The starting Elo value for all individuals, default is 1000

outputfile

Name of csv file to save ranks to. Default is NULL, in which case the function will only return a table in R. If you supply an output file name the function will save the results as a csv file in your working directory.

returnR

whether to return an R object from the function call. Default is TRUE

p_function

function defining probability of winning. Default "sigmoid" is equation (1) from Foerster, Franz et al 2016. Use "pnorm" to use the pnorm-based method implemented in the EloRating package.

Details

This function accepts a data frame of date-stamped dominance interactions and (optionally) a data frame of start and end dates for each individual to be ranked, and outputs daily Elo scores with parameters specified by the user. The default function used to determine probability of winning is equation (1) from Foerster, Franz et al. 2016, but for ease of comparison with the EloRating package, we also added the option to use the pnorm-based method implemented in the EloRating package, and future development will add the option to use the original function from Elo 1978 (as implemented in the elo package). This function does not require large presence matrices, and efficiently calculates a series of additional indices (described below).

As opposed to the eloratingopt function, this procedure only requires that included individuals have at least one win or one loss.

A detailed description of the function output is given in the Value section of this help file:

Value

Returns a list with six elements:

Examples

1
2
3
4
nbadata = EloOptimized::nba #nba wins and losses from the 1995-96 season
nbaelo = eloratingfixed(agon_data = nbadata)
# generates traditional Elo scores (with init_elo = 1000 & k = 100) and saves 
#   them as "nbaelo" 

EloOptimized documentation built on May 2, 2019, 10:39 a.m.