Skip to content

Learn

Statistics, maths and machine learning, each one introduced through a football question.

Every intermediate piece, series by series, in part order.

How many shots until his hat-trick? The Negative Binomial distribution

The Geometric distribution waits for the first goal. The Negative Binomial waits for the third, or the fifth. It shows how long a hat-trick really takes, and it has a second job modelling goals that vary more than Poisson allows.

Intermediate Part 6 of Statistics Through Football

Why the average transfer fee misleads. The Log-Normal distribution

Transfer fees, wages and market values can't go below zero, cluster low and have a few enormous outliers. The Log-Normal distribution describes them, and shows why the average fee is a poor guide to a typical one.

Intermediate Part 12 of Statistics Through Football

How long does a manager last? Survival analysis

Half of Scottish top-flight managers are gone within 465 days. Getting that number right means counting the managers who haven't left yet, which is what survival analysis is for. It also shows the danger never fades, and that a bad start matters less than fans think.

Intermediate Part 13 of Statistics Through Football

Bad run or bad manager? Spotting a real change with CUSUM

A run of ten games five points below what the odds expected turns up in 56% of Scottish top-flight seasons, and luck alone produces one in 55%. Clubs then go back to the level the odds expected. An alarm built to catch a real change shows why boards can't tell a bad manager from a bad run in time.

Intermediate Part 14 of Statistics Through Football

Best eleven or best combination? Cohort analysis and the midfield partnership

Midfield partnerships seem to get better the longer they play together. Follow 1,859 real partnerships game by game and the rise comes from the bad ones being broken up: the kept ones were good from their first game. Plus what the mix of a three-man midfield is worth once you compare like with like.

Intermediate Part 15 of Statistics Through Football

4-3-3 without the ball, 3-2-5 with it. Formations as transformations

A formation is a set of player positions, and the change from the defensive shape to the attacking one is a transformation. Measure it and you can see how far the team moves, how much it stretches, and which player's job is different.

Intermediate Part 7 of Linear Algebra Through Football

Who links the play? Passing networks as matrices

Write down who passes to whom and you have a matrix. Its rows and columns count passes made and received, and multiplying it by itself shows how the ball travels in two passes, who links defence to attack, and who plays the one-twos.

Intermediate Part 10 of Linear Algebra Through Football

Top at halfway. Who'll win the league? From beliefs to predictions

Take what we believe about every team, play the rest of the season thousands of times, and count who wins. Tested on 25 SPFL title races, the simulation's favourite won 20; the side top at halfway won 17.

Intermediate Part 5 of Bayesian Thinking Through Football

Three questions and a prediction. Decision trees

A decision tree predicts a match the way a pundit reasons, with a string of yes-or-no questions, and it learns which questions to ask from the data. On five SPFL test seasons two questions nearly match logistic regression; twelve fall apart.

Intermediate Part 9 of Machine Learning Through Football

Ask a hundred pundits. Random forests

One decision tree is jumpy, so grow a hundred, each on a slightly different set of matches, and average what they say. On five SPFL test seasons the forest fixes most of a single tree's wild guesses, and still finishes just behind logistic regression.

Intermediate Part 10 of Machine Learning Through Football

Learning from its mistakes. Gradient boosting

Start with a rough guess, look at what it got wrong, and fix a little of it with a small tree. Repeat a few hundred times. On five SPFL test seasons gradient boosting draws level with logistic regression, and shows where three numbers run out.

Intermediate Part 11 of Machine Learning Through Football

Matches like this one. K-nearest neighbours

To forecast a match, find the past matches most like it and see what happened. No training, no weights, just the right number of lookalikes. On five SPFL test seasons, the 300 nearest draw level with logistic regression.

Intermediate Part 15 of Machine Learning Through Football

Clue by clue. Naive Bayes, and the danger of counting twice

Start with how often each result happens, then let every clue shift the odds. It's how spam filters work, and on three overlapping football clues it gets worse the more it's told. Merge the clues into one and it draws level with logistic regression.

Intermediate Part 17 of Machine Learning Through Football

Four ways to play. K-means and team styles

Give a computer eight stats for 310 Scottish team-seasons and no labels, and K-means sorts them into four styles, from dominant to outshot. The outshot sides who foul a lot take no more points than the ones who don't.

Intermediate Part 18 of Machine Learning Through Football

What happens next season? Time series and ARIMA

A club's points a game, season after season, is a time series. For most clubs a season remembers the last two or three; a match remembers nothing. Smoothing over every past season forecasts next season better than last season alone, about nine points either way.

Intermediate Part 19 of Machine Learning Through Football

Expected goals from scratch. Where everyone stood

Most expected-goals models only know where a shot was taken. Train one on 95,162 real shots that also record where the keeper and defenders stood, and it gets within touching distance of a professional model. Then drag the players yourself.

Intermediate Part 20 of Machine Learning Through Football

How does a model learn? Rolling downhill with gradient descent

Machine learning models learn by measuring how their error changes as they adjust a setting, then stepping downhill. That's the derivative at work. 25 SPFL seasons show it finding how much of last season's scoring carries into this one.

Intermediate Part 6 of Calculus Through Football

Where should he put it? Penalties and the Nash equilibrium

A penalty taker and a goalkeeper choose at almost the same moment, and any habit gets punished. Game theory says both should mix it up, and says exactly how often. The professionals turn out to do almost exactly that.

Intermediate Part 1 of Game Theory Through Football

Why Gijón wasn't a prisoner's dilemma

In 1982 West Germany and Austria knew a 1–0 win for West Germany put them both through, and for 80 minutes nobody tried to change it. Game theory's most famous puzzle, the prisoner's dilemma, explains why deals fall apart. Gijón shows the other kind, the deal that needs no one to agree to it.

Intermediate Part 3 of Game Theory Through Football

Who designs the game? Three points for a win and the rules behind the football

Every part of this series took the rules as fixed. The people who write them are playing a game too, choosing payoffs so that players' own best moves give the football they want. Three points for a win shows how, and 25 Scottish seasons re-scored at two points show what it changed.

Intermediate Part 6 of Game Theory Through Football

Go in hard or pull out? Hawks, doves and the 50/50 challenge

Two players chase a loose ball. Go in hard and you might win it, or collide. Pull out and you're safe, but beaten. Game theory says there's no best choice, only a best mix, and a simple rule about who got there first beats both.

Intermediate Part 7 of Game Theory Through Football

Why make the dummy run? Bluffing, decoys and how often to fake

A striker who only runs when the pass is coming is easy to mark. Mix in runs that are never meant to get the ball and the defender can't tell which to follow. Game theory says exactly how often to bluff, and shows the dummy runs pay off through the real ones.

Intermediate Part 10 of Game Theory Through Football

Why must the whole back four step up together? The stag hunt and the offside trap

The offside trap is all or nothing. If every defender steps up, the striker is caught; if one holds, he plays him on and the rest are stranded. Game theory calls this a stag hunt, and it shows why a settled back four can run the trap and a patched-up one shouldn't try.

Intermediate Part 11 of Game Theory Through Football

Why does the club that wins the transfer race so often lose? The winner's curse

When several clubs chase the same striker, the one that gets him is usually the one whose scouts rated him highest, and that often means it paid too much. Auction theory calls this the winner's curse, and it says the more clubs are in the race, the less you should offer.

Intermediate Part 12 of Game Theory Through Football

Who's the best striker? The Pareto front

The best striker usually means more than one thing: goals, fee, age. The Pareto front throws out every option beaten on all of them and leaves the ones worth arguing about. It also shows why some good choices never top a weighted score, and which 2025/26 Premiership sides nobody beat at both ends.

Intermediate Part 3 of Decision Science Through Football

Who plays how much? Squad minutes as a linear program

A season has a fixed number of minutes to share out, every player has limits, and the club has rules. Linear programming finds the best split, explains why the answer always sits at a corner, and says what each rule costs, including where a youth-minutes rule should take its minutes from.

Intermediate Part 4 of Decision Science Through Football

£30m and five gaps: why you can't sign 0.83 of a centre-back

A transfer budget and five positions to strengthen. Treat it as a linear program and the answer signs 0.83 of one centre-back and 0.17 of another. Integer programming finds the best set of whole players, branch and bound finds it without trying every combination, and the budget's value turns into a staircase.

Intermediate Part 6 of Decision Science Through Football

Who marks whom? The assignment problem at set pieces

Five markers, five attackers at a corner. Putting your best header on their most dangerous man sounds right and concedes more. The assignment problem finds the best set of pairings, the Hungarian method solves it by hand, and 190 real corners a season turn the difference into goals.

Intermediate Part 7 of Decision Science Through Football

Playing out under a press: the safest route isn't the shortest

The opposition presses high and every pass is a risk. Treat the team as a network, with each passing lane carrying its chance of getting through, and the safest way from keeper to striker turns out to be three passes, not one. Dijkstra's method finds it, and shows which lane the press should aim at.

Intermediate Part 8 of Decision Science Through Football

Who gets there first? Timing a pass, and the cost of waiting

A pass is a race between the ball and the nearest defender. Work out when each gets there, turn the gap into a chance, and one touch on the ball turns a switch that gets there 95% of the time into one that gets there 78%. The idea behind pitch control and the Action and Reaction board.

Intermediate Part 13 of Decision Science Through Football

Did VAR change Scottish football? Difference-in-differences

VAR arrived in the Premiership in October 2022; the Championship never got it. Comparing the two leagues' changes says VAR cut yellow cards by 0.6 a game and fouls by nearly two. A season-by-season check shows why neither claim holds.

Intermediate Part 3 of Cause and Effect Through Football

Does finishing sixth rather than seventh matter? Regression discontinuity

After 33 games the Premiership splits and the side in sixth joins the top six. Next season, the sides that were sixth and seventh do just as well as each other. Widen the comparison and a top-six effect seems to appear. Why only the clubs right at the line can tell you about the line.

Intermediate Part 4 of Cause and Effect Through Football

Sacked after a bad run, poached after a good one. Event studies

Line up every Premiership manager change by the day it happened and look game by game. Sides that sacked their manager were sinking and then bounced; sides whose manager was poached were flying and then fell back. The line before the change tells you why it happened, and both end up where the club usually is.

Intermediate Part 6 of Cause and Effect Through Football

Is a half-time lead worth what it looks like? Matching like with like

Sides a goal up at half-time win 70% of the time; sides level win 32%. But the sides in front were usually the better sides before kick-off. Matching each leader with level sides that were just as fancied beforehand shows what the lead itself is worth, and what matching can never fix.

Intermediate Part 7 of Cause and Effect Through Football