pm_eloRunTimeSlice: pm_eloRunTimeSlice

Description Usage Arguments Value Examples

View source: R/eloFunctions.R

Description

Compute and update ELO scores for a single time slice. Within the time slice all matches are assumed to be happening in parallel.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pm_eloRunTimeSlice(
  eloDB,
  matchDB,
  simDF,
  simulateResults = FALSE,
  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

simDF

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

simulateResults

Whether to overwrite actualResult with simulated outcomes

Value

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

Examples

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

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