A Python code snippet demonstrating the new 'create_dixon_coles_grid' function in the penaltyblog library. The code shows how to initialize a probability grid using expected goals (lambdas) for the home and away teams, and then calculate home win probabilities, over/under 2.5 goal totals, and Asian Handicaps directly from that grid.
π penaltyblog v1.9.0 is live! πβ½οΈ
New in this version:
β
create_dixon_coles_grid(): Use lambdas from external ML models.
β
goal_expectancy_extended(): Infer rho/lambdas from odds.
π οΈ Improved quarter lines (2.25/2.75) logic for totals market.
β‘οΈ More optimisations to FootballProbabilityGrid
28.02.2026 17:12
π 8
π 0
π¬ 0
π 0
A technical MCMC Trace Plot with two horizontal subplots labeled "attack_Arsenal" and "home_advantage." Each plot shows four overlapping colored lines (Chains 0 to 3) creating a dense, horizontal "fuzzy caterpillar" shape. This visualization indicates that the Bayesian model has successfully converged and is stable across 2,000 iterations.
Why build a custom MCMC sampler from scratch?
In my latest blog post, I dig into the "why" and the "how". From the decision to drop heavy dependencies like Stan for this use case, to using Cython for speed, and how to interpret those "fuzzy caterpillar" plots.
Read it here: pena.lt/y/2026/01/08...
08.01.2026 20:03
π 2
π 0
π¬ 1
π 0
What can you do with v1.8.0?
β
Bayesian Dixon-Coles: Quantify uncertainty, not just point estimates
β
Hierarchical Models: Learn league-wide variance to handle small sample sizes
β
Built-in trace plots: Ensure model convergence
β
Familiar API: Works seamlessly with existing scrapers and weights
08.01.2026 20:01
π 1
π 0
π¬ 1
π 0
A dark-themed code editor window showing Python code using the penaltyblog library. It demonstrates initializing a HierarchicalBayesianGoalModel with home/away goals and teams, fitting the model using MCMC sampling with parameters like 2000 samples and 4 chains, and finally predicting match probabilities for an Arsenal vs. Manchester City fixture
Bayesian goal models are back in penaltyblog v1.8.0 - and this time, theyβre dependency-free! β½οΈπ
08.01.2026 20:00
π 13
π 3
π¬ 1
π 0
β½ penaltyblog v1.7.1 is now available:
Added params_array and param_indices functions to goal models to make it easier to work with the model's parameters.
Thank you to Sebastian Velandia for this contribution!
pip install --upgrade penaltyblog
29.12.2025 12:23
π 1
π 0
π¬ 0
π 0
π A couple of important notes:
You'll need your own Opta subscription/credentials to use this (I provide the tools, not the data!) π
As this is a v1 release of the integration, there's likely some rough edges. If you run into any, let me know - I'm happy to work with you to improve it. π€
09.12.2025 19:06
π 0
π 0
π¬ 0
π 0
Code example showing how the penaltyblog python package can now integrate directly with the StatsPerform Opta API to download data directly.
β½ penaltyblog v1.7.0 is now available: Direct integration with the Opta (Stats Perform) API.
You can now stream matches & events lazily without downloading the JSON first. Includes helpers for human-readable filtering (no more memorising IDs).
pip install --upgrade penaltyblog
09.12.2025 19:05
π 6
π 0
π¬ 1
π 0
Have been doing Advent of Code in Nim and Kotlin this year and enjoying learning both. I can see Nim becoming one of my favourite languages!
04.12.2025 21:30
π 1
π 0
π¬ 0
π 0
Thanks Nils, itβs a good point and is on my todo list to dig further into how long it takes for something like FSAA to stabilise to something useful early on in a playerβs career. Even with a fairly wide HDI at that stage, thereβs still potentially benefits to its use
24.10.2025 12:05
π 1
π 0
π¬ 0
π 0
Not yet, but good idea!
20.10.2025 17:02
π 1
π 0
π¬ 0
π 0
Shrinkage, Uncertainty, and Son Heung-min: Using Bayesian Methods to Identify Finishing Ability
Why most finishing metrics are flawed and how a Bayesian approach gives us a truer picture of a player's finishing ability...
New article: "Shrinkage, Uncertainty, and Son Heung-min: Using Bayesian Methods to Identify Finishing Ability"
which discusses using a Bayesian hierarchical approach to quantifying player finishing ability, with credible intervals to express uncertainty.
pena.lt/y/2025/10/01...
20.10.2025 16:34
π 22
π 5
π¬ 3
π 7
π penaltyblog v1.6.1 is out!
β¨ What's new:
- Python 3.14 support
- scipy 1.16+ compatibility
- Better numerical stability for Negative Binomial model
- New Colab notebook for implied probabilities example
pip install --upgrade penaltyblog
17.10.2025 18:54
π 4
π 3
π¬ 0
π 0
Absolutely. Also, people started sharing big (for then anyway) pre-trained networks that made it much easier to get started. I built many models in my day job back then by fine tuning BERT and ImageNet that I would have struggled to train from scratch without investing massively in compute.
07.10.2025 20:18
π 0
π 0
π¬ 0
π 0
We can also split Massey Ratings into attack & defence:
π΄ LFC: best attack in the league paired with a mid-table defence
βͺοΈ ARS: Elite at both ends. They have the #1 defence and the #3 attack
π³ Forest: A disaster at both ends of the pitch
07.10.2025 19:55
π 10
π 1
π¬ 0
π 0
Massey Ratings for the English Premier League
Here's how the Premier League table really looks according to Massey Ratings, which account for strength of schedule.
π Arsenal (+1.5) & Man City (+1.3) are clear strongest overall
π¬ Man Utd (-0.2) rank in the bottom half
π West Ham & Forest (-1.2) are worst teams by far
07.10.2025 19:54
π 14
π 4
π¬ 3
π 2
Thanks to everyone who suggested features and reported issues. Your input shapes the package's development.
Questions or feedback welcome at pena.lt/y/contact
Install: pip install penaltyblog
GitHub: github.com/martineastwo...
23.09.2025 19:47
π 0
π 0
π¬ 0
π 0
penaltyblog: Football Data & Modelling Made Easy β penaltyblog documentation
π Interactive Colab notebooks are available in the docs - experiment with real examples without any local setup.
I'll be steadily expanding these over the coming weeks to cover all functionality in the package.
Docs: penaltyblog.readthedocs.io
23.09.2025 19:46
π 0
π 0
π¬ 1
π 0
π§ Improved implied odds module:
- New logarithmic overround removal method for better accuracy
- Structured results instead of raw arrays
- Better handling of edge cases
Making it easier to work with bookmaker probabilities in your analyses.
23.09.2025 19:46
π 0
π 0
π¬ 1
π 0
π° Expanded betting utilities:
- Kelly Criterion for multiple outcomes
- Arbitrage opportunity detection
- Value bet identification
- Hedge bet calculations
- Odds format conversion (decimal/fractional/American)
All functions now return structured outputs for easier integration.
23.09.2025 19:45
π 0
π 0
π¬ 1
π 0
β½ penaltyblog v1.6.0 is now available!
π MatchFlow updates:
- SQL-style joins for nested football data (left, right, outer, inner, anti)
- Cloud storage support: read/write directly to AWS S3, Google Cloud Storage, and Azure Blob
- Automatic type inference for join keys
pip install penaltyblog
23.09.2025 19:45
π 1
π 0
π¬ 1
π 0
penaltyblog: Football Data & Modelling Made Easy β penaltyblog documentation
π Docs: penaltyblog.readthedocs.io/en/latest/in...
π» GitHub: github.com/martineastwo...
π pip install penaltyblog
Feedback welcome, let me know what you build!
15.08.2025 19:04
π 1
π 0
π¬ 0
π 0
Image of code showing examples of penaltyblog Flow's new DSL
π New: Flow Query DSL
Filter datasets with safe, Pythonic expressions:
- AST-parsed (no eval)
- Variables, regex, dates
- Access nested fields
15.08.2025 18:59
π 0
π 0
π¬ 1
π 0
Image of code demonstrating the the features in penaltyblog's goals models
π Goal models are now 5-10Γ faster
- Cython-powered analytical gradients for speed + stability
- Fine-tune with minimizer_options:
15.08.2025 18:57
π 1
π 0
π¬ 1
π 0
GIF demonstrating the interactive tooltips in penaltyblog's new Pitch plotting API
β½ New: Pitch Plotting API
Build interactive football visualisations with:
- Multiple layouts & themes
- Scatter, heatmaps, arrows, comets
- Custom hover tooltips
15.08.2025 18:55
π 0
π 0
π¬ 1
π 0
π penaltyblog v1.5.0 is here!
β
Interactive pitch plots
β
5-10Γ faster goal models
β
New Flow query DSL
Whatβs new π
15.08.2025 18:53
π 4
π 2
π¬ 1
π 0
How Accurate Are Soccer Odds? A Data Dive into 250 Million Betting Lines
A data-driven deep dive into how accurately bookmakers price global soccer markets...
π New article on my blog: How Accurate Are Soccer Odds? A Data Dive into 250 Million Betting Lines
π How sharp are different bookmakers?
π How accurate are bookmaker's odds?
π― Are the odds well-calibrated?
β‘οΈ pena.lt/y/2025/07/16...
16.07.2025 18:19
π 16
π 4
π¬ 0
π 0