Skip to content

footBayes

2.1.0Package record

Fitting Bayesian and MLE Football Models

0packages depend
7.6Kdownloads / year
18.4%test coverage
13/13flavors OK

Overview

About

This is the first package allowing for the estimation, visualization and prediction of the most well-known football models: double Poisson, bivariate Poisson, Dixon-Coles, negative binomial, Skellam, student_t, diagonal-inflated bivariate Poisson, and zero-inflated Skellam. It supports both maximum likelihood estimation (MLE, for 'static' models only) and Bayesian inference. Team abilities can be static or dynamic over weeks or seasons, with alternative specifications of the evolution variance: a common variance (Owen, 2011), variance inflation after the summer break (Koopman and Lit, 2015) doi:10.1111/rssa.12042, and weighted dynamic models with commensurate priors (Macrì-Demartino, Egidi and Torelli, 2026) doi:10.1093/jrsssc/qlag032. Historical team strengths can be estimated through a Bayesian Bradley-Terry-Davidson model and used as a covariate. For Bayesian methods, it incorporates several techniques: MCMC sampling with Hamiltonian Monte Carlo, variational inference using either the Pathfinder algorithm or Automatic Differentiation Variational Inference (ADVI), and the Laplace approximation. The package compiles all the 'CmdStan' models once during installation using the 'instantiate' package. The model construction relies on the most well-known football references, such as Dixon and Coles (1997) doi:10.1111/1467-9876.00065, Karlis and Ntzoufras (2003) doi:10.1111/1467-9884.00366 and Egidi, Pauli and Torelli (2018) doi:10.1177/1471082X18798414.

Changes in 2.1.0

New models

  • Add the Dixon-Coles model ("dixon_coles") to stan_foot(), static and dynamic, and to mle_foot().
  • Add the negative binomial model ("neg_bin") to mle_foot().

Dynamic models in stan_foot()

  • Add dynamic_par to choose the evolution variance: a common variance (common_sd, Owen, 2011) or a variance inflation after the summer break (kl_variance and periods_per_season, Koopman and Lit, 2015).
  • Add dynamic_weight for the weighted dynamic models with commensurate priors (Macrì Demartino, Egidi and Torelli, 2026), with spike and slab hyperpriors set through dynamic_par$spike and dynamic_par$slab.

Other changes

  • print.stanFoot() with teams keeps all the global parameters and shows the team names in the team-indexed parameters.
  • foot_prob() supports the "dixon_coles" and "neg_bin" MLE models.
  • Add an identifiability constraint to the Bradley-Terry-Davidson Stan models.
  • Extend the confidence intervals of mle_foot() to the model-specific parameters and move the MLE simulations to the internal simulate_goals_mle().
  • Rewrite the vignette.
Show all changes in 2.1.0Hide the rest of the changes in 2.1.0

Bug fixes

  • Fix the likelihood of the static bivariate Poisson model.
  • Draw y_rep and y_prev of the bivariate Poisson models from the bivariate Poisson distribution.
  • Rewrite the diagonal-inflated bivariate Poisson model as in Karlis and Ntzoufras (2003), with the new parameter draw_dist for the draws.
  • Return diff_y_prev in the bivariate Poisson and diagonal-inflated bivariate Poisson models.
  • Fix the AIC and BIC of mle_foot() to count only the free parameters of each model.
  • Fix foot_prob() for MLE models, which used object$home instead of object$home_effect.
  • Fix compare_foot() with NA rows in a probability matrix, which misaligned the outcomes of the following elements of source.
  • Match ranking in stan_foot() to the teams by name instead of by position, with informative errors for missing or duplicated teams.
  • Fix the observed frequencies in pp_foot(type = "aggregated") for models fitted with predict > 0.

Documentation

  • Update foot_abilities() for the six MLE models.
  • Fix the documentation of italy, priors, btd_foot(), compare_foot(), plot_logStrength() and of norm_method and rho in stan_foot().

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.9 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-10-15
  • NOTE11 OK, 2 NOTE2026-07-16
  • OK12 OK2026-04-25
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 2.1.0
READMEYes · 411 wordsVignettesYes · 1 · staticNEWSYes · 100% structured · mentions 2.1.0Citation fileNo
Help pages
17
Examples that run
0%11 never run
Exported functions with examples
92%
Documented parameters
92%
Return-value docs
100%
Help pages citing references
24%

Downloads

7.6K
CRAN downloads in the past year
Rank #5,581 · ~21/day · ~633/mo
Daily download trend is not available in this view yet.
58230 days
1.5K90 days
7.6K1 year
Compare downloads with other packages →
Also on494 r2u6 autocran81 c2d4u

Repository

61Stars
11Forks
4Open issues
0Open PRs
0Releases
699Commits
3Commit identities
699 commits · Last activity 2026-10-14 · +3.4% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-08-24 · 452026-10-20 · 61
PracticesBeta

9 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/leoegidi/footbayes on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
README.Rmd

GitHub Pages site last deployed 2026-10-14 · The repository has a site deploy workflow

Coverage (1)
Coverage reporting
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
20 external dependencies (excludes base and recommended)

Installing footBayes adds 63 packages (34 with compiled code, 64 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, ggplot2 6.0 MB.

Depends (1)
R >= 4.2.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.0 (2022)
Author · added in 2.0.0
Author · added in 2.1.0
Listed in earlier versions (2)
Vasilis Palaskas.
no longer listed · 0.2.0 to 2.0.0
Demartino
no longer listed · 1.0.0
Releases (5)

Pick two releases to compare their code metrics.

  • 2.1.0Latest
    record
    2026-10-07 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 2.0.0
    record
    2025-05-16 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 1.0.0
    record
    2025-01-09 · diff ↗ ·
    added 4 exports
    btd_foot, compare_foot, plot_btdPosterior, plot_logStrength
  • R
    R 4.4.0 released · 2024-04-24
  • 0.2.0
    record
    2023-08-31 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.0
    record
    2022-02-21
  • R
    R 4.1.0 released · 2021-05-18

Package metadata

First published
2022-02-21
Total releases
5 / 4 yrs
License
GPL-2 OSI
Additional repositories
stan-dev.r-universe.dev
Minimum R
≥ 4.2.0
Bundled data
1,003 KB / 2 files
Download size
3.2 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("footBayes")
Egidi, L., Macrì Demartino, R., & Palaskas, V. (2026). footBayes: Fitting Bayesian and MLE Football Models (Version 2.1.0) [Computer software]. https://doi.org/10.32614/CRAN.package.footBayes

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for footBayes version 2.1.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy