Markets coveredMatch OddsCorrect ScoreOver / UnderFirst HalfSecond Half
Statometrics
Model Library · Bayesian methods and time series

Empirical Bayes

Use the whole population of trainers, jockeys or teams to set a prior, then shrink each individual's record towards it by the right amount.

Intermediatepre-matchevaluation

In one sentence

Empirical Bayes estimates the prior from the data of the whole group, then uses it to pull each individual's small-sample record back towards reality.

How it works

Every football database is full of eye-catching rates: a team that has gone over 2.5 in 9 of its first 10 games, a side that "always scores first at home". Most of these are luck, because with hundreds of teams some will look extreme by chance.

Empirical Bayes answers the question "what should I believe about this one team, given what I know about teams in general?" First, look at the spread of records across all teams and fit a distribution that describes how teams typically vary. That fitted distribution becomes your prior.

Then each team's record is blended with that prior. A small record is shrunk heavily towards the average; a large record is left mostly alone. It is a quick, practical approximation to a full hierarchical Bayesian model and needs no MCMC.

The maths

With win/loss data and a Beta prior fitted to the population:

p^i=α+kiα+β+ni\hat{p}_i = \frac{\alpha + k_i}{\alpha + \beta + n_i} weight on own record=nini+α+β\text{weight on own record} = \frac{n_i}{n_i + \alpha + \beta}
  • p̂ᵢ: the shrunk rate for team i.
  • α and β: parameters of the population prior, fitted from all teams (for example by matching the average and spread of their rates).
  • kᵢ: successes for team i (for example, games over 2.5).
  • nᵢ: games played by team i.

In plain English: treat every team as if it had already played α plus β games at the population average, then add its real record on top.

Worked betting example

You are looking at team over 2.5 goals rates, with Betfair offering over 2.5 at 1.80 (implied ≈ 55.6%). All figures are illustrative.

  1. Population prior. Across all teams in the league, about 50% of games go over 2.5, and true team rates vary with a standard deviation of about 8 percentage points. A Beta(19, 19) prior matches both figures.
  2. Team A. 9 overs from its first 10 games, a raw 90%. Shrunk rate = (19 + 9) ÷ (38 + 10) = 28 ÷ 48 ≈ 58.3%. Own record gets only 10 ÷ 48 ≈ 21% of the weight. Fair odds ≈ 1.71, not the 1.11 the raw rate suggests.
  3. Team B. 78 overs from 114 games over three seasons, a raw 68.4%. Shrunk rate = 97 ÷ 152 ≈ 63.8%, fair odds ≈ 1.57. Own record gets 75% of the weight.
  4. Expected value of £10 back at 1.80, 2% commission. Naive A: 0.90 × £8 × 0.98 minus 0.10 × £10 ≈ +£6.06. Shrunk A: 0.583 × £7.84 minus 0.417 × £10 ≈ +£0.40. Shrunk B: ≈ +£1.38.
  5. Which to trust. A's 90% credible range is about 46.5% to 69.7%, which still includes the 55.6% implied by the price. B's is about 57.3% to 70.1%, entirely above it. B's case rests on far firmer ground.

Note that a team's over rate is one input, not a full price; the opponent still matters.

Where it's good

  • Team goal rates (over 2.5, first-half goals, both teams scoring) early in a season, when small samples tempt you with false patterns.
  • Trainer, jockey, sire and course angles in racing.
  • Player prop rates (cards, shots on target) for players with few appearances.
  • Early-season team stats before a full model has enough data.
  • Screening a large set of "systems" to see which survive shrinkage.
  • A cheap stand-in for a full hierarchical model when speed matters.

Limitations and pitfalls

  • It uses the data twice (once for the prior, once for each estimate), so uncertainty is slightly understated. With large populations the effect is small.
  • The population must be sensible. Mixing Premier League sides with National League sides gives a prior that fits nobody.
  • A rate ignores price. A team that goes over 2.5 in 70% of games is no bet if the market already prices it at 1.35; always compare against the market's implied probability or use profit and loss per bet.
  • Data-mined angles need a multiple-testing mindset; shrinkage helps but does not fully cure searching through thousands of combinations.
  • The Beta prior assumes a single-humped spread of ability; a small elite group can break this.
  • Markets often price well-known team patterns already, so surviving angles tend to be small.

How to build it

  • scipy.stats.beta.fit, or a method-of-moments calculation in pandas, fits α and β.
  • The ebbr package in R wraps the whole workflow.
  • Data: results by team or angle, with Betfair closing prices so you can compare with implied probability.
  • Practical tip: fit the prior only on individuals with a minimum sample (say 10 games) so the noise of tiny records does not inflate its spread.
Learn it step by step
18+ only. Educational content, not financial or betting advice. Past results do not guarantee future returns. If gambling stops being fun, get free, confidential help at BeGambleAware.org.
Members