pm_eloRunMultipleTimeSlices: pm_eloRunMulitpleTimeSlices

Description Usage Arguments Value Examples

View source: R/eloFunctions.R

Description

Compute and update ELO scores for multiple time slices. Within each individual time slice all matches are assumed to be happening in parallel.

Usage

1
2
3
4
5
6
7
8
9
pm_eloRunMultipleTimeSlices(
  eloDB,
  matchDB,
  eloDF,
  tennisElo = TRUE,
  Cfactor = 250,
  Coffset = 5,
  Cshape = 0.4
)

Arguments

eloDB

a dictionary of player ELO scores

matchDB

a dictionary of matches a player has played

eloDF

a dataframe of matches to process. Requires at least 'player_name', 'opponent_name', 'match_date' columns

Value

a list with three items: the updated eloDB, the updated matchDB and the input eloDF updated with ELO columns. New columns are prefixed with 'elo_'

Examples

1
2
3
4
5
6
7
tmpres = pm_eloPrepDatabase(unseenDataPlayers=c('bob','charlie'))
eloDB = tmpres$eloDB
matchDB = tmpres$matchDB
mysim = tibble::tribble(~player_name,~opponent_name,~match_date,~actualResult,
'bob','charlie',as.Date('2007-01-01'),1,
'bob','david',as.Date('2007-01-02'),0)
tmpres = pm_eloRunMultipleTimeSlices(eloDB,matchDB,mysim)

quietsnooze/pmpackage documentation built on March 7, 2021, 3:50 p.m.