BBTm.with.formula {speedyBBT} | R Documentation |
This function fits the Bradley-Terry model with comparison and player specific effects. Each comparison can be assigned a real value to allow for a specific effect for the comparison, such as bias, ordering or home/away effect. The value of this effect is denoted kappa. The player specific effects are described through a formula and data.frame containing the value. The function places a normal prior distribution on both kappa and the player specific parameters beta.
BBTm.with.formula(
outcome,
player1,
player2,
formula = NULL,
data = NULL,
advantage = NULL,
kappa.initial = NULL,
kappa.var = NULL,
player.prior.var = NULL,
beta.initial = NULL,
n.iter = 1000,
hyperparameter = TRUE,
chi = 0.01,
psi = 0.01
)
outcome |
vector of outcomes. 1 if player2 is the winner, 0 if player1 is the winner |
player1 |
vector of first players. |
player2 |
vector of second players. |
formula |
formula with no left-hand-side specifying the player specific effects |
data |
data.frame with a row corresponding to each player and column corresponding to each covariate. |
advantage |
(optional) a vector with the value of the comparisons specific effect for each comparison |
kappa.initial |
(optional) an initial value for the comparison specific value kappa |
kappa.var |
(optional) the prior variance of the he comparison specific value kappa |
player.prior.var |
(optional) matrix specifying the prior covariance of the player correlation parameters |
beta.initial |
(optional) vector containing the values of the player specific parameters for the first MCMC iteration |
n.iter |
number of MCMC samples to be drawn |
hyperparameter |
boolean indicating if inference should be performed for the prior variance hyperparameter. If TRUE the prior variance (main diagonal of the covariance matrix) must be set to 1. |
chi |
rate parameter for the inverse-gamma prior distribution on the hyperparameter |
psi |
shape parameter for the inverse-gamma prior distribution on the hyperparameter |
If player.prior.var
is omitted, independent and identical
N(0, 5^2) prior distributions are placed on each object quality parameter.
If beta.initial
is omitted, it is set to a vector of zeroes.
If kappa.var
is omitted, it is set to N(0, 5^2), if kappa.initial
is omitted
it is set to 0.5.
A data frame containing samples from the posterior distribution