Skip to content

Learn

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

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

Goal or miss? The Bernoulli distribution

A penalty has two outcomes and nothing in between. That simple idea, the Bernoulli trial, is the building block of expected goals and of most football statistics.

Beginner Part 1 of Statistics Through Football

How many goals will we score? The Poisson distribution

A team averages two goals a game. How likely is it to score exactly three? The Poisson distribution turns an average into a probability for every score, and it sits underneath most football prediction models.

Beginner Part 3 of Statistics Through Football

Win, draw or lose? The Multinomial distribution

A match has three possible results, not two. The Multinomial distribution handles any number of outcomes, and shows why a team's "expected" record over ten games almost never happens exactly.

Beginner Part 7 of Statistics Through Football

How fast is fast? The Normal distribution

Ranking players from fastest to slowest tells you the order, not how unusual anyone is. The Normal distribution, and its standard deviation, measures how far a player stands out from the rest.

Beginner Part 10 of Statistics Through Football

Are gifted players less athletic? Collider bias and the academy

Pick the best 200 of 5,000 young players and, among those picked, the more technical turn out to be the less athletic, even when the two have nothing to do with each other. How the way you choose your data can create a link that was never there, with a simulator and a real check on league tables.

Beginner Part 16 of Statistics Through Football

Better finishers, or luck? The standard error and the luck margin

Hearts scored with 34.7% of their shots on target last season and Dundee United with 28.8%. How far luck alone can move a rate like that, how to put a margin round it, and why most of the gap in finishing between clubs is luck.

Beginner Part 17 of Statistics Through Football

Are TV games duller? Hypothesis tests and p-values

Premiership games moved from Saturday 3pm, mostly for television, have more goals, and a shuffle test says the gap is no fluke. How a hypothesis test works, what a p-value does and doesn't tell you, and why this one still isn't about the cameras.

Beginner Part 18 of Statistics Through Football

A midfielder's match in five numbers. Vectors

A player's performance can be written as a list of numbers in a fixed order. That list is a vector, and it's the first step to comparing players, finding replacements and feeding football into machine learning.

Beginner Part 1 of Linear Algebra Through Football

Four players, four numbers each. The whole team becomes a matrix

One player's performance is a vector. Stack several players together and you have a matrix, the grid that almost all of data science starts from. Multiply it by a set of weights and every player gets a rating.

Beginner Part 2 of Linear Algebra Through Football

Where did he run? Describing player movement with vectors

A run from one spot on the pitch to another is a vector, how far forward and how far across. From that pair of numbers you get the length of the run, its direction, its speed and whether it was heading for goal.

Beginner Part 5 of Linear Algebra Through Football

Forward or sideways? Passing as a vector

Every pass has a start and an end, so every pass is a vector. That turns "he never passes forward" from an opinion into a number, and shows why a player's average pass can hide half of what he does.

Beginner Part 6 of Linear Algebra Through Football

Four from four. How good is he really? Bayesian thinking

A new signing scores his first four penalties. Bayesian thinking combines what you believed before with what you've just seen, and shows why a perfect start should nudge your opinion, not replace it.

Beginner Part 1 of Bayesian Thinking Through Football

1–0 up at half-time. Will they hold on? Bayes' theorem

A half-time lead is evidence, and what it means depends on who's leading. Bayes' theorem combines the pre-match odds with the half-time score, and 5,419 SPFL matches show it working.

Beginner Part 3 of Bayesian Thinking Through Football

Four from six. Is the new manager really better?

Rangers sacked Russell Martin after one win in seven league games; Danny Röhl won four of his first six. A Bayesian comparison puts the chance he's genuinely better at about nine in ten, not the near-certainty it felt like, and shows why more games couldn't settle it.

Beginner Part 8 of Bayesian Thinking Through Football

What are we trying to predict? Features and targets

Every machine learning model starts with two decisions, what to predict and what to tell the model. The first is the target, the second the features, and real SPFL results show why the features matter as much as the model.

Beginner Part 1 of Machine Learning Through Football

Has the model learned, or just memorised? Training data and test data

A model that has seen the answers will always look brilliant. Holding matches back to test it, and choosing which ones, is how you find out whether it can predict a match it hasn't seen. Real SPFL seasons show the difference.

Beginner Part 2 of Machine Learning Through Football

Brilliant in training, gone on matchday. Overfitting

A model can learn its training matches too well, rules and all, and then fall apart on matches it hasn't seen. Real SPFL seasons show how it happens, how to spot it, and what to do about it.

Beginner Part 3 of Machine Learning Through Football

Too simple or too clever? Underfitting vs overfitting

A model can fail by being too simple to see the patterns or too complicated to ignore the noise. Real SPFL seasons, and the bookmakers, show what each looks like and where the sweet spot sits.

Beginner Part 4 of Machine Learning Through Football

Stubborn or jumpy? Bias and variance

A model can be too rigid to learn, or so sensitive that one result rewrites everything it believes. Those are bias and variance, and twenty-five years of SPFL results show what each costs.

Beginner Part 5 of Machine Learning Through Football

One good season or a good model? Cross-validation

A single test season can flatter a model or bury it. Cross-validation tests it again and again on different slices of the data; for football, that means walking forward through the seasons. 23 SPFL seasons show why it matters.

Beginner Part 6 of Machine Learning Through Football

Is accuracy the right score? Evaluating a model

Accuracy counts how many results a model called right, and hides almost everything else. A confusion matrix shows where the mistakes are, probability scores show how confident it was, and five SPFL seasons show why draws break accuracy.

Beginner Part 7 of Machine Learning Through Football

How many shots is a goal worth? Linear regression

Draw the best straight line through 310 Scottish team-seasons and it says a goal comes every 3.1 shots on target. Then test it on seasons it never saw, and watch one version break when the way shots are counted changes.

Beginner Part 16 of Machine Learning Through Football

Still accelerating, or at full speed? The derivative

Still accelerating, at full speed, lost a yard of pace. Each is about what's happening at one moment, which is what the derivative measures, and it gives coaches something to train, measure and improve.

Beginner Part 2 of Calculus Through Football

Is his acceleration fading? The second derivative

Two players can hit the same top speed and look identical for a second, then one pulls clear. The difference is how quickly their acceleration fades, and that is the second derivative.

Beginner Part 3 of Calculus Through Football

Who's the best signing? It depends what you're optimising

Five players on a shortlist, £10m to spend. Chase goals and you sign the striker. Chase points and three cheaper players beat him. Add one rule and the answer changes again. The three parts of every optimisation problem, with a transfer window.

Beginner Part 1 of Decision Science Through Football

Shoot, cross or keep the ball? It depends on the score

A goal isn't worth the same at every score. Real half-time results show one down a side can afford to risk two goals against for every goal it might score, and one up barely half of one. The same chance can be the right call in one game and the wrong one in the next.

Beginner Part 10 of Decision Science Through Football

Does home advantage vanish once you count the shots? Causal diagrams

Home sides take about a third of a point a game more than away sides. Compare matches where both sides had the same shots-on-target edge and the advantage all but disappears. Why that doesn't make home advantage a myth, and how a causal diagram tells you what to hold fixed.

Beginner Part 2 of Cause and Effect Through Football