← All projects

Hull City Premier League Predictor

A season simulator and analytics app for Hull City's 2026/27 Premier League campaign, built around one question — do Hull City stay up? Two Dixon-Coles models, validated on held-out seasons and tested live against the bookmakers.

  • Python
  • Flask
  • JavaScript
  • Statistics
  • Monte Carlo

A Premier League season simulator and analytics app built around a single question: do Hull City stay up? A Python/Flask backend with a dependency-free single-file frontend, pulling match data and Opta stats from public APIs and deriving every rating, simulation and projection locally. It runs locally rather than as a hosted app, so there is no live demo; the source is on GitHub.

What it does

  • Monte Carlo season simulation — 200,000 seasons, parallelised across cores, giving every club’s title, European and relegation odds plus a full finishing-position distribution.
  • Survival model — the headline question: the points total that has historically been enough to stay up, and each rival’s relegation odds conditional on Hull surviving.
  • Match predictor — a Dixon-Coles bivariate Poisson model giving win/draw/loss, the most likely scoreline and a full score grid.
  • Live table and Live tab — in-progress scores animate onto the standings, and in-play win/draw/loss is re-projected from the score and the minutes left (stoppage time included), alongside a per-match 1–10 player rater.
  • Player ratings scored against positional peers across all 20 squads, not just teammates.
  • Points-deduction support (e.g. an FFP sanction) that flows through the table, projections and every simulated season.
  • Ops panel on a separate loopback address for refreshing data and restarting the app without taking it down.

How the model works

Team ratings come from a Dixon-Coles joint fit: every side’s attack and defence, plus the league’s home and away scoring rates, fitted together on the season’s games so each result is judged against who it came against. Each game counts as a blend of goals and shots on target, because shot volume repeats from game to game and finishing doesn’t. There are two models, identical except for that blend — one tuned for single matches, one for season simulation.

Older games count for less (half weight after 240 days), and every side is shrunk toward a pre-season prior built from a composite z-index of eight correlated attacking metrics. That fits only two parameters per team, so there is little to overfit. Promoted sides, who have no top-flight history, all start from one shared prior: the average first Premier League season of every side promoted since 2006/07.

Season simulations draw each side’s strength from the fit’s own uncertainty plus a little weekly drift, so a team rated on few or old games is less predictable than one with a long recent record. All of it runs through a single shared matchXG() function, so the predictor, live tab, projections and simulations can never disagree about how good a team is.

Testing it honestly

The tuning used a fit/test split: parameters were chosen on 2008/09–2019/20 and judged once on 2020/21–2025/26, seasons that played no part in choosing anything. On those held-out seasons the two-model fit beat the previous model on where teams finished (better in 4 of 6 seasons from 1 November) and on single games, scored with the ranked probability score.

The app also tests itself on the live season. Every prediction for an unplayed fixture is frozen as soon as the result is recorded, then scored against the bookmakers’ odds. A reconstruction that re-predicts each game using only the results before it scored 0.2096 against the bookmakers’ 0.2088 over the first 110 games, on a season the model was never tuned on.

Most ideas tested were rejected, and the rejections are the useful part: separate attack and defence blends, starting every side from league average, and alternative home-advantage schemes all looked better on the fit seasons and did no better, or worse, held out. Mismatch damping and extra weight on 2–2 and 0–1 scorelines, which an earlier version used, were dropped for the same reason.

Engineering notes

  • Python 3 / Flask backend with a process manager; vanilla HTML/CSS/JS frontend with no build step and no external JS dependencies.
  • Monte Carlo runs in Web Workers to keep the UI responsive.
  • Data is merged cheapest-detail-first from several public sources (Pulse/Opta, football-data.co.uk, ESPN), cached locally and backfilled as richer fields arrive.
  • A suite of validation scripts replays 18 Premier League seasons to compare models, calibration and bookmaker benchmarks.
  • No data ships with the repo — everything is fetched into git-ignored caches on first run and is fully regenerable; only the code is MIT-licensed.