Description Usage Arguments Value Examples
View source: R/calculate_pi_ratings.R
This function calculates dynamic performance ratings called "pi ratings" for sport teams in competitive matches. The pi rating system was developed by Constantinou and Fenton (2013) <doi:10.1515/jqas-2012-0036>
1 | calculate_pi_ratings(teams, outcomes, lambda, gamma, b, c, return_e)
|
teams |
an (n x 2) character matrix, contains unique names for the respective home and away teams in n subsequent matches |
outcomes |
an (n x 2) numeric matrix, contains the points that the respective home and away teams scored in n subsequent matches |
lambda |
a constant, the learning rate for performance from recent matches, default value: 0.035 |
gamma |
a constant, the learning rate for performance from home to away and vice versa, default value: 0.7 |
b |
a constant, logarithmic base, default value: 10 |
c |
a constant, default value: 3 |
return_e |
a boolean variable, conditions the function to return either the mean squared error when return_e = TRUE, or the pi ratings when return_e = FALSE, default value: FALSE |
either an (n x 2) matrix containing the pi ratings for the teams in the n input matches or the mean squared error for the specific parameter setting, conditional on boolean parameter return_e being FALSE or TRUE
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.