In one sentence
A GLM keeps the simple weighted-sum idea of linear regression but lets the outcome follow a distribution that suits it, such as Poisson for goals.
How it works
Linear regression assumes outcomes are bell-shaped around a straight line. Goals, cards and corners are whole numbers that cannot be negative, and win/lose outcomes are yes or no. A GLM handles all of these with two choices.
First, pick a distribution for the outcome: normal for times, binomial for yes/no, Poisson or negative binomial for counts, gamma for skewed positive amounts. Second, pick a link, a function that connects the weighted sum to the average outcome; for counts this is usually the log, which keeps predictions positive.
Logistic regression is a GLM. So is the classic Maher-style football model, where each team's goals are Poisson with a log rate built from attack strength, the opponent's defence and home advantage.
The maths
- E[Y]: the average outcome, such as expected goals.
- g: the link function (log for counts, logit for probabilities).
- λ: expected goals for a side.
- μ: league baseline; h: home advantage.
- a: attack strength; d: defence strength (higher means better defence).
In words: build a score from the inputs, then use the link to turn it into a sensible average for that kind of outcome.
Worked betting example
A fitted Poisson GLM gives μ = 0.10 and h = 0.25. Home side: attack 0.30, defence 0.15. Away side: attack 0.05, defence −0.10.
- Home log rate: 0.10 + 0.25 + 0.30 − (−0.10) = 0.75, so λ home = e^0.75 ≈ 2.12 goals.
- Away log rate: 0.10 + 0.05 − 0.15 = 0.00, so λ away = e^0 = 1.00 goal.
- P(home scores) = 1 − e^(−2.12) ≈ 88.0%. P(away scores) = 1 − e^(−1.00) ≈ 63.2%.
- Treating the two as independent, P(both teams to score) ≈ 0.880 × 0.632 ≈ 55.6%. Fair price ≈ 1.80.
- Betfair offers 1.85 on BTTS yes. £10 stake at 2% commission: a win pays £8.50 × 0.98 = £8.33. EV ≈ 0.556 × £8.33 − 0.444 × £10 ≈ +£0.19.
- At 1.92 EV rises to about +£0.57. At 1.85 the edge is too small to trust once model error is considered.
Where it's good
- Goals, corners, cards and shots markets, using Poisson or negative binomial GLMs.
- Team attack and defence ratings with home advantage in one fitted model.
- Yes/no markets via the binomial (logistic) GLM.
- Adding context such as weather, referee or rest days as extra terms.
- A transparent baseline that is hard to beat for many football markets.
Limitations and pitfalls
- Poisson assumes the variance equals the mean; cards and corners are usually more spread out, so use negative binomial.
- Independent home and away Poisson goals slightly misprice low scores and draws; Dixon-Coles corrects this.
- Straight-line effects on the link scale can miss curves; GAMs relax this.
- Team strengths change through a season; without time weighting the model lags.
- Many team parameters with few matches overfit early in the season.
- BTTS and goal markets in top leagues are efficient; a GLM rarely finds big edges there.
How to build it
- Python: statsmodels GLM (family=Poisson, NegativeBinomial, Binomial), penaltyblog for ready-made football models; R: glm.
- Data: one row per team per match, with goals, team, opponent and a home flag.
- Add exponential time decay weights, as in Dixon and Coles (1997), so recent matches count more.
- Tip: check for overdispersion by comparing the residual deviance to the degrees of freedom before trusting Poisson.
Related methods
- Linear regression: the special case with a normal outcome and no link.
- Logistic regression: the binomial GLM.
- Poisson distribution: the standard outcome for goal counts.
- Negative binomial: for counts more spread out than Poisson allows.
- Dixon-Coles model: a corrected Poisson GLM for football scorelines.