mle_foot | R Documentation |
Fits football goal-based models using maximum likelihood estimation. Supported models include: double Poisson, bivariate Poisson, Skellam, and Student's t.
mle_foot(
data,
model,
predict = 0,
maxit = 1000,
method = "BFGS",
interval = "profile",
hessian = FALSE,
sigma_y = 1
)
data |
A data frame containing match data with columns:
|
model |
A character specifying the model to fit. Options are:
|
predict |
An integer specifying the number of out-of-sample matches for prediction. If missing, the function fits the model to the entire dataset without making predictions. |
maxit |
An integer specifying the maximum number of optimizer iterations default is 1000). |
method |
A character specifying the optimization method. Options are
For further details see |
interval |
A character specifying the interval type for confidence intervals. Options are
|
hessian |
A logical value indicating to include the computation of the Hessian (default FALSE). |
sigma_y |
A positive numeric value indicating the scale parameter for Student t likelihood (default 1). |
MLE can be obtained only for static models, with no time-dependence.
Likelihood optimization is performed via the BFGS
method
of the {optim}
function in stats
package.
A named list containing:
att
: A matrix of attack ratings, with MLE and 95% confidence intervals (for "double_pois"
, "biv_pois"
and "skellam"
models).
def
: A matrix of defence ratings, with MLE and 95% confidence intervals (for "double_pois"
, "biv_pois"
and "skellam"
models).
abilities
: A matrix of combined ability, with MLE and 95% confidence intervals (for "student_t"
only).
home_effect
: A matrix with with MLE and 95% confidence intervals for the home effect estimate.
corr
: A matrix with MLE and 95% confidence intervals for the bivariate Poisson correlation parameter (for "biv_pois"
only).
model
: The name of the fitted model (character).
predict
: The number of out-of-sample matches used for prediction (integer).
sigma_y
: The scale parameter used in the Student t likelihood (for "student_t"
only).
team1_prev
: Integer indices of home teams in the out-of-sample matches (if predict > 0
).
team2_prev
: Integer indices of away teams in the out-of-sample matches (if predict > 0
).
logLik
: The maximized log likelihood (numeric).
aic
: Akaike Information Criterion (numeric).
bic
: Bayesian Information Criterion (numeric).
Leonardo Egidi legidi@units.it and Roberto Macrì Demartino roberto.macridemartino@deams.units.it
Baio, G. and Blangiardo, M. (2010). Bayesian hierarchical model for the prediction of football results. Journal of Applied Statistics 37(2), 253-264.
Egidi, L., Pauli, F., and Torelli, N. (2018). Combining historical data and bookmakers' odds in modelling football scores. Statistical Modelling, 18(5-6), 436-459.
Gelman, A. (2014). Stan goes to the World Cup. From "Statistical Modeling, Causal Inference, and Social Science" blog.
Karlis, D. and Ntzoufras, I. (2003). Analysis of sports data by using bivariate poisson models. Journal of the Royal Statistical Society: Series D (The Statistician) 52(3), 381-393.
Karlis, D. and Ntzoufras,I. (2009). Bayesian modelling of football outcomes: Using the Skellam's distribution for the goal difference. IMA Journal of Management Mathematics 20(2), 133-145.
Owen, A. (2011). Dynamic Bayesian forecasting models of football match outcomes with estimation of the evolution variance parameter. IMA Journal of Management Mathematics, 22(2), 99-113.
## Not run:
library(dplyr)
data("italy")
italy <- as_tibble(italy)
italy_2000_2002 <- italy %>%
dplyr::select(Season, home, visitor, hgoal, vgoal) %>%
dplyr::filter(Season == "2000" | Season == "2001" | Season == "2002")
colnames(italy_2000_2002) <- c("periods", "home_team", "away_team", "home_goals", "away_goals")
mle_fit <- mle_foot(
data = italy_2000_2002,
model = "double_pois"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.