The Penalty Blog

Insights, research, and analysis on football analytics.

Calculating Expected Threat in Python Using Linear Algebra

Published on January 08, 2025 by Martin Eastwood

This article walks through how to calculate expected threat in Python using linear algebra instead of the original convergence method...

Read More
Estimating Goal Expectancy From Bookmaker's Odds

Published on December 02, 2022 by Martin Eastwood

This article walks through how to estimate goal expectancies from bookmaker's odds using Python...

Read More
Penaltyblog Python Package Updated to v0.5.1

Published on November 04, 2022 by Martin Eastwood

My penaltyblog python package has been updated to v0.5.1 to include new Bayesian football (soccer) models and web scrapers...

Read More
Ten Years of pena.lt/y/blog

Published on October 18, 2022 by Martin Eastwood

It's been ten years since I started this blog...

Read More
Scraping Football Data Using the penaltyblog Python Package

Published on August 05, 2022 by Martin Eastwood

This article shows how to use the penaltyblog python package to scrape football data...

Read More
Predicting Football Results Using Bayesian Modelling with Python and PyMC3

Published on August 25, 2021 by Martin Eastwood

This article looks at how to predict football results using a Bayesian hierarchical model built in Python and PyMC3...

Read More
Predicting Football Results Using Python and the Dixon and Coles Model

Published on June 24, 2021 by Martin Eastwood

Building on the last article, we upgrade our Poisson model with the Dixon and Coles adjustment and time decay...

Read More
Predicting Football Results With the Poisson Distribution

Published on June 18, 2021 by Martin Eastwood

A tutorial about predicting football results using Python and the Poisson distribution...

Read More
Which Young Players Will be Stars?

Published on May 19, 2021 by Martin Eastwood

Using my Player Ratings model to identify the best footballing prospects...

Read More
Predicting Player Career Trajectories

Published on May 03, 2021 by Martin Eastwood

Predicting what player's potential career trajectories look like...

Read More
Sharing xG Using Multi-touch Attribution Modelling

Published on November 23, 2019 by Martin Eastwood

Reattributing xG using multi-touch attribution modelling...

Read More
VAR, What is it Good For?

Published on August 22, 2019 by Martin Eastwood

As Edwin Starr famously said, VAR, what is it good for? Well, let's find out...

Read More
Opta Pro Forum 2018

Published on November 21, 2018 by Martin Eastwood

I finally wrote about the presentation I gave at the Opta Pro 2018 Forum....

Read More
Automated Feature Engineering

Published on May 25, 2018 by Martin Eastwood

I recently gave a presentation on automated feature engineering at MancML....

Read More
Deep Learning in R Using Keras

Published on September 11, 2017 by Martin Eastwood

I recently gave a presentation at the Manchester R Users Group on Deep Learning in R using Keras....

Read More
An Alternatve to Radars for Visualising Football Data

Published on July 17, 2017 by Martin Eastwood

I've long been critical of the use of radar plots for visualizing football data and was recently challenged by a reader of this blog to come up with a better alternative so here we go...

Read More
Opta Pro Forum 2017

Published on March 11, 2017 by Martin Eastwood

I wrote up the poster presentation I gave at the 2017 Opta Pro Forum for the Opta Pro blog looking at using machine learning to quantify footballer's decisions....

Read More
Opta Pro Forum 2016

Published on December 20, 2016 by Martin Eastwood

With the 2017 Opta Pro Forum rapidly approaching, I thought it was about time I transcribed my presentation from the previous event....

Read More
A Footballer Recommendation Engine

Published on June 30, 2016 by Martin Eastwood

With the transfer window well under way I thought I'd discuss my footballer recommendation engine for identifying potential transfer targets....

Read More
Expected Goals and Uncertainty

Published on April 29, 2016 by Martin Eastwood

My Twitter feed seems to be increasingly taken up with discussions of Expected Goals in football yet there always seems to be something important missing from the discussion, and that's uncertainty...

Read More
Ranking Football Teams Using Google's Page Rank Algorithm

Published on March 21, 2016 by Martin Eastwood

I've discussed various techniques for ranking football teams on my blog before, such as using Massey Ratings to account for strengt...

Read More
It’s Not Just The Money: Quality of Signings Suggest China Could Become a Major Power in Club Football

Published on February 29, 2016 by Martin Eastwood

John Burn-Murdoch and the Financial Times have used my PlayerRatings model to analyse the recent flux of players moving to teams in the Chinese Super League - you can read the full article Read More

Frequency of Draws in Football

Published on December 12, 2015 by Martin Eastwood

There has been some discussion and misunderstanding around the low frequency of draws in football on my Twitter feed recently so I thought I'd just give a quick recap around why the probabilities o...

Read More
Updated Massey Ratings

Published on November 24, 2015 by Martin Eastwood

Updated Massey ratings for the English Premier League showing how well teams are really doing when you account for their strength of schedule...

Read More
Mathematically Optimising Your Fantasy Football Team: Redux

Published on August 07, 2015 by Martin Eastwood

The Premier League’s fantasy football is back ready for the new season so I thought I’d run through an example of how linear programming can help you mathematically select your team.

Read More
Expected Goals And Support Vector Machines

Published on July 13, 2015 by Martin Eastwood

I've written about expected goals on this website before but I've changed approach recently so I thought I'd write up some of the different ideas I've been playing around with...

Read More
PlayerRatings And False Negatives

Published on April 23, 2015 by Martin Eastwood

My last article looked at how well my PlayerRatings model predict...

Read More
Backtesting PlayerRatings

Published on April 09, 2015 by Martin Eastwood

Following my last article discussing my Read More

PlayerRatings And Team Quality

Published on March 09, 2015 by Martin Eastwood

My previous article introduced PlayerRatings, a mathematical model I’ve been working on over the past few months to quantify the ability of individual footballers. One of the nice characteristics o...

Read More
PlayerRating: A Bayesian Method For Evaluating Football Players

Published on February 26, 2015 by Martin Eastwood

I originally submitted the idea behind this article to the recent Opta Pro Forum and although it was turned down I thought I’d write it up anyway incase anyone else was interested in the results......

Read More
Mathematically Optimising Your Fantasy Football Team: Update

Published on January 21, 2015 by Martin Eastwood

It's transfer window time so here's your mathematically optimised fantasy football team...

Read More
Massey Ratings For Football Part Two

Published on December 04, 2014 by Martin Eastwood

In part one I introduced Massey Ratings and how they can be used to rank football teams in a way that accounts for their strength of schedule. Next, we’ll take a look at how Massey Ratings can be e...

Read More
Massey Ratings For Football Part One

Published on November 27, 2014 by Martin Eastwood

We all know the league table can lie and one of the common causes of this is strength of schedule. Take Southampton, at the time of writing they are currently second in the Premier League twelve ma...

Read More
English Premier League Pythagorean

Published on November 04, 2014 by Martin Eastwood

I’ve not posted this for a while so here is the latest Pythagorean for the English Premier League.

Read More
Predicting Football Using R

Published on November 02, 2014 by Martin Eastwood

I recently gave a presentation to the Manchester R Users' Group discussing how to predict football results using R. My presentation gave a brief overview of how to create a Poisson model in R and a...

Read More
Expected Goals: Foot Shots Versus Headers

Published on August 28, 2014 by Martin Eastwood

My last article on expected goals introduced the concept of using exponential decay to estimate the probability of scoring based on the shooter’s distance from the goal. The article received lots o...

Read More
Mathematically Optimising Your Fantasy Football Team

Published on July 24, 2014 by Martin Eastwood

The Premier League’s fantasy football is back ready for the new season so I thought I’d run through an example of how linear programming can help you mathematically select your team.

Read More
Expected Goals And Exponential Decay

Published on April 22, 2014 by Martin Eastwood

In my last article on expected goals I showed how to incorporate the distance from goal along the Y axis into the expected goal model using Pythagoras’ Theorem. This all worked pretty well, giving ...

Read More
Expected Goals: The Y Axis

Published on April 16, 2014 by Martin Eastwood

Expected goals are one of the hot topics in the football analytics community at the moment and it’s a topic I’ve previously written a number of articles on discussing how to calculate them. If you ...

Read More
English Premier League Pythagorean Update

Published on April 04, 2014 by Martin Eastwood

I’ve not posted an update on the Pythagorean for the English Premier League (EPL) for a while so the latest figures are below.

Read More
Expected Goals Updated

Published on March 01, 2014 by Martin Eastwood

When I introduced my Expected Goals model a few weeks back a number of people commented on the bump in the curve where I had included penalty shots in the data set used to fit the model...

Read More
Actual Goals Versus Expected Goals

Published on February 15, 2014 by Martin Eastwood

Since my last post about how to calculate expected goals one question has come up more than any other and that is about the correlation between expected goals and actual goals..

Read More
Expected Goals For All

Published on February 12, 2014 by Martin Eastwood

It seems that everybody has their own expected goals models for football nowadays but they all seem to be top secret and all appear to give different results so I thought I post a quick example of ...

Read More
Comparing Players Using Cluster Analysis

Published on February 10, 2014 by Martin Eastwood

As there were a couple of presentations at the recent Opta Pro Forum talking about identifying player similarities I thought I’d give a quick example of how to do something similar using k-means cl...

Read More
EPL 2013/2014: Football Pythagorean So Far

Published on January 20, 2014 by Martin Eastwood

Welome back! Now that I'm no longer part of Onside Analysis I'm free to start blogging again so let's start off by taking a look at how my football Pythagorean is doing for the English Premier Leag...

Read More
UEFA Champions League – Route To The Final

Published on September 30, 2013 by Martin Eastwood

With the UEFA Champions League group stage now underway I took a look at what it typically takes for teams to reach the final.

Read More
Analysing Football Teams Using Cluster Analysis and Principal Component Analysis

Published on August 30, 2013 by Martin Eastwood

The amount of football data available is growing rapidly – with every passing week of the season more matches are played and even more data gets collected. This is great as it allows us to increase...

Read More
Anouncement

Published on June 19, 2013 by Martin Eastwood

You may have noticed that my blogging has slowed down over the past few weeks and the reason is that I have joined Onside Analysis as a computational statistician.

Read More
Betting With The Eastwood Index And Kelly Criterion

Published on May 23, 2013 by Martin Eastwood

I demonstrated in my last post that the odds calculated using the Eastwood Index were slightly more accurate than the bookmakers over the course of the football season. My next goal is to work out ...

Read More
Did The Eastwood Index Beat The Bookmakers?

Published on May 21, 2013 by Martin Eastwood

It’s the end of the season so it’s time to review how the Eastwood Index performed over the year and how it compared with the bookmakers...

Read More
EI Match Probabilities for the English Premier League

Published on May 17, 2013 by Martin Eastwood

We have finally reached the end of the season so for the last time in 2012-2013 here are the Eastwood Index’s (EI) probabilities for the English Premier League...

Read More
EI Match Probabilities for the English Premier League

Published on May 10, 2013 by Martin Eastwood

Here are the latest match probabilities for the English Premier League calculated using the Eastwood Index (EI)...

Read More
MLS Player Salaries: 2013

Published on May 10, 2013 by Martin Eastwood

The latest Major League Soccer (MLS) salaries were released recently by the MLS Players’ Union so I thought I would post a quick summary of the data...

Read More
The Eastwood Index, MLS and Parity

Published on May 07, 2013 by Martin Eastwood

I showed in my last post how Major League Soccer (MLS) is a much more closely matched league than the English Premier League (EPL), with the wage cap and draft system increasing the parity between ...

Read More
EI Match Probabilities for the English Premier League

Published on May 03, 2013 by Martin Eastwood

Here are the latest match probabilities for the English Premier League calculated using the Eastwood Index (EI)...

Read More
How Much Does Luck Affect MLS?

Published on May 02, 2013 by Martin Eastwood

Following my recent article for Betting Expert quantifying how large a role luck plays in the English Premier League (EPL) I thought it would be interesting to look at Major League Soccer (MLS) too...

Read More
How Much Does Luck Affect Football?

Published on April 30, 2013 by Martin Eastwood

I’ve written a new article for Betting Expert quantifying how much luck affects football...

Read More
What Is A Meaningful Sample Size?

Published on April 28, 2013 by Martin Eastwood

I had an article published at Betting Expert last week looking at how to determine statistically how much data you need to make accurate predictions...

Read More
EI Match Probabilities for the English Premier League

Published on April 26, 2013 by Martin Eastwood

It’s been a busy day but I’ve finally got the probabilities for this weekend’s matches completed....

Read More
EI Match Probabilities for the English Premier League

Published on April 19, 2013 by Martin Eastwood

It’s been a busy day but I’ve finally got the probabilities for this weekend’s matches completed....

Read More
EI Match Predictions for the English Premier League

Published on April 12, 2013 by Martin Eastwood

Here we go with this week’s predictions from the Eastwood Index (EI)!...

Read More
EI Match Predictions for the English Premier League

Published on April 05, 2013 by Martin Eastwood

A couple of weeks back I demonstrated how the EI is more accurate than the bookies based on rank probability scores but a few people have asked if I can do something a bit simpler so...

Read More
Understanding Total Shot Ratio in Football

Published on April 02, 2013 by Martin Eastwood

The use of Total Shot Ratio (or TSR) seems to have slowly been gaining ground so I thought it would be worth analyzing the statistic in more detail to see what it can and cannot do.

Read More
EI Match Predictions for the English Premier League

Published on March 28, 2013 by Martin Eastwood

After last week’s international matches, domestic football is finally back so here are this weekend’s match predictions using my EI predictive model. Let’s see if it can keep up its good form and c...

Read More
How Accurate Are The EI Football Predictions?

Published on March 21, 2013 by Martin Eastwood

Unfortunately time caught up with me last week and I was unable to post any predictions from my Eastwood Index. However, since then I have been busy validating the results to see how accurate the p...

Read More
Is Brendan Rogers Improving Liverpool?

Published on March 13, 2013 by Martin Eastwood

As well as using my EI Index to predict future matches, it can also be used to look back at how team’s performances have changed over time. An interesting example is Liverpool, who sacked Kenny Da...

Read More
EI Match Predictions for the English Premier League

Published on March 08, 2013 by Martin Eastwood

Here we go again!

Read More
EI Match Predictions for the English Premier League

Published on March 01, 2013 by Martin Eastwood

Since last week’s predictions turned out to be so popular I thought I would continue testing the EI index in public so here are this week’s predictions. Fingers crossed they turn out well again!......

Read More
EI Match Predictions for the English Premier League

Published on February 28, 2013 by Martin Eastwood

Last week was a big test for my new EI index – it had finally reached the point where I was confident it was working well enough to post its predictions in public.

Read More
EI Match Predictions for the English Premier League

Published on February 21, 2013 by Martin Eastwood

For a bit of fun, here is a trial run at predicting this weekend’s EPL matches using my EI ratings. I haven’t compared these with anyone else’s odds yet but they generally look about what I would h...

Read More
Introducing the Eastwood Index

Published on February 21, 2013 by Martin Eastwood

On the whole, the Elo system works okay but it was not designed with football in mind and so there are some issues with it - for example it can only handle two distinct outcomes – winning and losin...

Read More
Understanding Elo Ratings Part Two

Published on February 07, 2013 by Martin Eastwood

Now that we understand the theory behind Elo ratings, let’s take a look at how to calculate them and how to make them more relevant to football...

Read More
Understanding Elo Ratings

Published on January 31, 2013 by Martin Eastwood

The Elo rating system was originally devised by its creator Arphad Elo as a way to calculate the average skill levels of two chess players. Although the system was created specifically for chess it...

Read More
Predicting Football Matches Using Shot Data Part Two

Published on January 25, 2013 by Martin Eastwood

Having found that the correlation between goals scored and shots on target was the strongest of the various shooting variables I had available to me, I decided to see how well they could predict th...

Read More
What Is The Chance of Bradford City reaching Wembley?

Published on January 22, 2013 by Martin Eastwood

With League Two’s Bradford City only one match away from playing at Wembley in the League Cup final I thought it would be interesting to see what the chances were of them getting this far...

Read More
Predicting Football Matches Using Shot Data

Published on January 21, 2013 by Martin Eastwood

Previously on this blog I have discussed my attempts at using the Poisson distribution to predict the number of goals scored in football matches. So far, the results have been...

Read More
Predicting The Premier League Using The Refined Pythagorean Equation

Published on January 18, 2013 by Martin Eastwood

New article for Betting Expert looking at the current Premier League standings compared with the predictions from my refined version of the Pythagorean Expectation.

Read More
How Early In The Season Can Pythagorean Predictions Be Made?

Published on January 02, 2013 by Martin Eastwood

The next stage for developing my refined version of the Pythagorean equation is to characterise how many weeks of data it actually needs to make accurate football predictions...

Read More
What Has Caused Dimitar Berbatov’s Recent Lack of Goals?

Published on December 15, 2012 by Martin Eastwood

Up until week 12 of the season, Dimitar Berbatov was one of the English Premier League’s top goal scorers and goal creators. However, since then he has gone 450 minutes without registering either a...

Read More
Using the Pythagorean Expectation Across Leagues Wordwide

Published on December 10, 2012 by Martin Eastwood

The next stage for my Pythagorean's development is to testing whether it can be applied to leagues outside the EPL. Having one Pythagorean equation that could be used globally is preferable to havi...

Read More
Applying the Pythagorean Expectation to Football: Part Two

Published on December 03, 2012 by Martin Eastwood

Part two of guide to applying the baseball pythagorean to football.

Read More
Applying the Pythagorean Expectation to Football: Part One

Published on November 26, 2012 by Martin Eastwood

Introduction to applying the baseball pythagorean to football.

Read More
Disparity in European Football Leagues

Published on November 20, 2012 by Martin Eastwood

Having mentioned the effect disparity plays on determining the league champions in previous posts I thought it would be interesting to look at the actual levels of disparity currently present in fo...

Read More
Analysis of André Villas-Boas Vs Harry Redknapp

Published on November 18, 2012 by Martin Eastwood

Since taking over as manager of Tottenham Hotspur, André Villas-Boas has been trapped in former Spurs manager Harry Redknapp’s shadow. Every tactical decision or team selection Villas-Boas makes is...

Read More
Effect of Season Length on Deciding the League Champion

Published on November 12, 2012 by Martin Eastwood

In my previous article I looked at the interplay between luck and skill in determining the league champions. There is another parameter though that also interacts with luck and that is the structur...

Read More
How Often Does The Best Team Win The League?

Published on November 08, 2012 by Martin Eastwood

How often does the best team win the league? Probably not as often as you think as it is not just talent that is required for success; a decent amount of luck is needed too.

Read More
The Poisson Model So Far

Published on November 02, 2012 by Martin Eastwood

In my last article I wrote about my experiences using the Poisson distribution to predict the outcome of football matches. The results so far have been rather disappointing so I thought I would hav...

Read More
Using Poisson to Predict Football Matches

Published on October 29, 2012 by Martin Eastwood

The Power Of Goals recently blogged about using the Poisson distribution to predict the outcome of football matches. I have been evaluating the predictive ability of the Poisson for the English Pre...

Read More
Influence Of Clean Sheets

Published on October 26, 2012 by Martin Eastwood

To make much sense of the statistics available for football we need to have an understanding of their context so I am planning on starting off simple by looking at baselines for various events and ...

Read More
Football + Mathematics

Published on October 22, 2012 by Martin Eastwood

There are plenty of analytical football blogs already out there on the internet so I thought long and hard about whether to bother with pena.lt/y..

Read More
It's Fergie Time

Published on October 19, 2012 by Martin Eastwood

After Manchester United’s recent defeat to Tottenham, Sir Alex Ferguson was once again furious about the amount of injury time played. He even went as far as to claim the four minutes Chris Foy add...

Read More
Hello World

Published on October 18, 2012 by Martin Eastwood

Hello!! Hopefully this blog will be live soon once I have worked out how to use it…

Read More