Bayesian Inference in Sports Prediction

Summary

Bayesian inference is a method of statistical inference where probabilities are updated as new evidence becomes available. In sports prediction, it allows modelers to start with prior beliefs about team strength (from historical data, Elo ratings, etc.) and update those beliefs based on new match results.

The core of Bayesian inference for sports betting involves:
1. Prior probability: Initial estimate of team strength or win probability (e.g., from Elo rating)
2. Likelihood: Probability of observed results given the prior
3. Posterior probability: Updated estimate after observing new data

For sports betting, Bayesian approaches are particularly powerful because: (a) we have rich historical data to form priors, (b) match results arrive sequentially, allowing continuous updating, and (c) uncertainty quantification is naturally incorporated (posterior distributions, not just point estimates).

Pinnacle's betting resources article notes that Bayesian analysis can help bettors gauge outcomes by combining subjective prior beliefs with objective observed data.

Key Concepts

  • Prior distribution: Belief about team strength before observing new data. Can be informative (based on historical data) or uninformative (flat).
  • Likelihood: P(data | parameters) — how likely are the observed results given our parameter values?
  • Posterior distribution: P(parameters | data) ∝ P(data | parameters) × P(parameters) — Bayes' theorem
  • Conjugate priors: For common distributions (Poisson, Binomial, Normal), the prior and posterior have the same distribution family, making updates analytically tractable
  • Hierarchical Bayesian models: Share information across teams/players, improving estimates for teams with few games
  • Markov Chain Monte Carlo (MCMC): For complex models without conjugate priors, numerical sampling methods (Gibbs sampling, Metropolis-Hastings) are used

Bayes' Theorem

$$P(\theta | data) = \frac{P(data | \theta) \times P(\theta)}{P(data)}$$

Where:
- P(θ) = prior probability of parameters
- P(data|θ) = likelihood of observed data given parameters
- P(data) = marginal likelihood (normalizing constant)
- P(θ|data) = posterior probability of parameters after observing data

Bayesian Model for Football Win Probability

import numpy as np
from scipy.stats import beta, gamma, norm

def bayesian_team_strength(observed_results, prior_mean=0, prior_var=400**2):
    """
    Bayesian update for team strength from observed match results.

    observed_results: list of (opponent_rating, margin) tuples
    prior_mean: prior strength estimate (e.g., Elo rating)
    prior_var: prior variance

    Returns: posterior mean and variance of team strength.
    """
    # Simplified: assume Normal likelihood, Normal prior
    # Posterior precision = prior precision + n * data precision
    prior_precision = 1 / prior_var
    n = len(observed_results)

    # Likelihood precision (assuming margin variance ~ 300^2 per game)
    like_var = 300**2
    like_precision = n / like_var

    # Posterior
    post_precision = prior_precision + like_precision
    post_mean = (prior_mean * prior_precision + sum(
        prior_mean + m for _, m in observed_results
    ) * like_precision / n) / post_precision

    post_var = 1 / post_precision
    return post_mean, post_var

def posterior_win_prob(home_strength, home_var, away_strength, away_var):
    """Compute P(home wins) from posterior distributions."""
    diff_mean = home_strength - away_strength
    diff_var = home_var + away_var
    # P(home wins) = P(diff > 0) where diff ~ Normal
    from scipy.stats import norm
    return norm.cdf(diff_mean / np.sqrt(diff_var))

Concrete Example

For World Cup prediction with a Poisson model:
- Prior: Team strength from historical Elo/xG data. Say Brazil has prior strength λ_Brazil ~ Gamma(α=10, β=1) (mean=10, variance=10)
- Likelihood: Observed results: Brazil 3-0, 2-1, 1-0 (3 matches, 6 goals total). Poisson likelihood.
- Posterior: Update Gamma parameters using conjugate update formulas → new λ estimate.
- Prediction: Use posterior predictive distribution: integrate over all possible λ values weighted by posterior probability.

Key Applications in Sports Betting

  1. Hierarchical Poisson model: Pool strength across teams with similar characteristics (e.g., by region), improving estimates for teams with few matches
  2. Dynamic Elo/Glicko: Bayesian update of ratings after each match
  3. Odds calibration: Bayesian approach to checking whether implied probabilities from bookmakers match true probabilities
  4. Injury/information updates: Update win probabilities when new information arrives (injury news, lineup changes) using Bayes' theorem

Notes

  • Bayesian inference naturally handles small sample sizes better than frequentist approaches through prior information
  • The choice of prior is critical — informative priors from historical data substantially improve predictions for teams with few games
  • For World Cup specifically: only 3 group stage games + potential knockouts; prior information is very valuable due to small sample
  • MCMC methods (PyMC, Stan) are increasingly used for complex Bayesian sports models but add computational overhead
  • Calibration of Bayesian predictions should be checked using reliability diagrams and Brier scores