Fit football models with Maximum Likelihood

Description

Fits football goal-based models using maximum likelihood estimation. Supported models include: double Poisson, bivariate Poisson, Dixon-Coles, negative binomial, Skellam, and Student's t.

Usage

mle_foot(
  data,
  model,
  predict = 0,
  maxit = 1000,
  method = "BFGS",
  interval = "profile",
  hessian = FALSE,
  sigma_y = 1
)

Arguments

Details

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.

Value

A named list containing:

  • att: A matrix of attack ratings, with MLE and 95% confidence intervals (for "double_pois", "biv_pois", "dixon_coles", "neg_bin" and "skellam" models).

  • def: A matrix of defence ratings, with MLE and 95% confidence intervals (for "double_pois", "biv_pois", "dixon_coles", "neg_bin" 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).

  • rho: A matrix with MLE and 95% confidence intervals for the Dixon-Coles dependence parameter (for "dixon_coles" only).

  • overdispersion: A matrix with MLE and 95% confidence intervals for the home and away overdispersion parameters (for "neg_bin" 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).

Author(s)

Leonardo Egidi legidi@units.it and Roberto Macrì Demartino roberto.macridemartino@deams.units.it

References

Baio, G. and Blangiardo, M. (2010). Bayesian hierarchical model for the prediction of football results. Journal of Applied Statistics 37(2), 253-264.

Dixon, M. J. and Coles, S. G. (1997). Modelling association football scores and inefficiencies in the football betting market. Journal of the Royal Statistical Society: Series C (Applied Statistics) 46(2), 265-280.

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.

Examples

## 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)