Learn R Programming

sport (version 0.1.0)

bbt_run: BBT rating algorithm

Description

BBT rating algorithm Wrapper arround `bbt` update algorithm. Wrapper allows user to simplify calculation providing only data and initial parameters assumptions

Usage

bbt_run(formula, data, r, rd, sigma, weight, beta = 25/6, kappa = 0.5,
  gamma, idlab, init_r = 25, init_rd = 25/3, pb = FALSE)

Arguments

formula

formula specifying model. BBT algorithm allows only player ranking parameter and should be specified by following manner: `rank | id ~ name`. Names in formula are unrestricted, but model structure remains the same:

  • rank player position in event.

  • id event identifier in which pairwise comparison is assessed.

  • name of player.

data

data.frame which contains columns specified in formula, and optionaly columns defined by `sigma`, `weight` or `date`.

r

named vector of initial rating estimates. In there is no assumption, initial ratings is set to be r=25 Names of vector should correspond with `name` in formula.

rd

named vector of initial rating deviation estimates. In there is no assumption, initial is set to be r=25/3 Names of vector should correspond with `name` in formula.

sigma

name of column in `data` containing rating volatility. Rating volitality is a value which multiplies prior `rd`. If `sigma > 0` then prior `rd` increases, making estimate of `r` more uncertain.

weight

name of column in `data` containing weights. Weights increasing or decreasing update change. Higher weight increasing impact of corresponding event.

beta

The additional variance of performance. As beta increases, the performance is more uncertain and update change is smaller. By default `beta = 25/6`.

kappa

controls `rd` shrinkage not to be greater than `rd*(1-kappa)`. `kappa=1` means that `rd` will not be decreased.

gamma

can help to control how fast the variance `rd` is reduced after updating. Lower `gamma` slows decreasing of `rd`, which tends to reach zero to quickly. The default value is `gamma = rd/c`.

idlab

name of column in `data` containing date. Doesn't affect estimation process. If specified, charts displays estimates changes in time instead of by observation `id`

init_r

initial values for `r` if not provided. Default = 25

init_rd

initial values for `r` if not provided. Default = 25/3

pb

logical, if TRUE progress bar will appear in console. Default = FALSE

Value

A "ratings" object is returned

  • final_r named vector containing players ratings.

  • final_rd named vector containing players ratings deviations.

  • r data.frame with evolution of the ratings and ratings deviations estimated at each event.

  • pairs pairwise combinations of players in analysed events with prior probability and result of a challange.

  • class of the object

  • method type of algorithm used

  • formula modelled formula

Examples

Run this code
# NOT RUN {
# Example from Glickman
data <- data.frame( name = c( "A", "B", "C", "D" ), 
                    rank = c( 3, 4, 1, 2 ))
bbt <- bbt_run( rank ~ name, data )
# }

Run the code above in your browser using DataLab