findK: Generate the appropriate K factor given a players score

Description Usage Arguments Details Value Note References Examples

Description

Given a players score, ranges of scores to associate with a K factor and the K values to use for the given ranges the function will find the appropriate K score to use for an elo rtaing update based on Neumann et al 2011.

Usage

1
findK(playerScore, kScaleBounds, kFactors)

Arguments

playerScore

the score of the player in question

kScaleBounds

the player score bins to associate with K factors

kFactors

the possible K factors to be used

Details

Given a parameterization of kScaleBounds = c(-Inf, 2100, 2400, Inf) and kFactors = c(32,24,16):

- If an individuals score is less than 2100 the kFactor assigned is 32

- Between 2100 and 2400 the kFactor assigned is 24

- A score above 2400 the the kFactor assigned is 16

Value

the players associated K factor

Note

In order to ensure a proper function call the kScaleBounds parameter must be sorted from least to greatest and must be of a length 1 greater than the length of the kFactors parameter. In addition assigning the first element of kScaleBounds to -Inf and the last to Inf will allow the players score to always remain within an acceptable range.

References

Neumann et al (2011) Assessing Dominance Hierarchies. Animal Behaviour

Examples

1
2
3
4
5
6
# generic function calls
findK (1000, kScaleBounds = c(-Inf, Inf), kFactors = 100)
findK (1000, kScaleBounds = c(-Inf, 1100, Inf), kFactors = c(32, 16))
# may cause errors in elo algorithim if range of kscale bounds isnt all real
# numbers but you can still call it this way
findK (1000, kScaleBounds = c(0, 500, 100, Inf), kFactors = c(32, 16, 8))

nmmarquez/linHierarchy documentation built on May 23, 2019, 9:28 p.m.