Inspiration
Every post-match take is the same: the goal, the scoreline, the highlight reel. But anyone who's actually watched a full match knows the goal is rarely where the match was won. It's the missed sitter in minute 23, the yellow card that changed a tactical setup, or the substitution nobody talks about.
Analysts recognize these turning points intuitively, but intuition is difficult to defend with evidence. We wanted to answer, with data instead of a hot take, the question every fan, coach, and analyst asks after a loss:
"Where did the match actually slip away?"
The 2022 FIFA World Cup was the perfect testbed: 64 matches with complete event-level StatsBomb data, allowing every key moment to be measured instead of debated.
What it does
MatchPoint reconstructs every World Cup match as a continuously evolving probability model.
For every shot, card, and substitution, it recalculates each team's chances of winning using Monte Carlo simulation (10,000 sampled futures), producing a live win-probability timeline throughout the match.
Instead of highlighting only goals, MatchPoint identifies the single event that produced the largest swing in win probability—the MatchPoint.
For shot events, we then flip that moment (goal → miss or miss → goal) and replay the remainder of the match to generate a statistically grounded counterfactual timeline showing how the result could have changed.
An AI analyst explains why that moment mattered in plain English, translating probability swings into insights that coaches, broadcasters, journalists, and casual fans can immediately understand.
Looking across the entire tournament also uncovers broader analytical patterns rather than isolated match stories:
- 73.4% of decisive moments occurred before the 60th minute.
- Nearly 1 in 6 matches hinged on a chance that never appeared on the scoresheet.
- Many of the tournament's biggest momentum swings came from missed opportunities rather than goals themselves.
These findings challenge the common assumption that the final goal is always the defining moment of a match.
How we built it
Everything computationally expensive is performed offline so the application loads instantly.
Data ingestion
- Loaded complete event data for all 64 World Cup matches using
statsbombpy.
Win probability engine
- At every shot, card, and substitution, we ran a Poisson-based Monte Carlo simulation (10,000 futures) using StatsBomb xG combined with a league-average Bayesian prior to prevent small-sample overreaction.
MatchPoint detection
- Computed the absolute change in win probability after every event and selected the maximum as the decisive moment.
Counterfactual engine
- For shot events, we flipped the outcome (goal ↔ miss) and re-simulated the remainder of the match instead of applying a simple probability adjustment, producing an entirely new win-probability trajectory.
AI explanations
- A Groq-powered LLM receives only structured match data (event, minute, player, team, probability changes) to generate grounded explanations without hallucinating football context.
Frontend
- React, Vite, and Recharts visualize live probability curves, counterfactual comparisons, tournament-wide analytics, and an "Ask the Analyst" interface backed by FastAPI.
What we learned
One early shot can fool a model.
Our initial implementation allowed a single high-xG chance in the opening minutes to inflate the expected scoring rate for the rest of the match, occasionally selecting the wrong MatchPoint. Introducing Bayesian shrinkage toward league-average scoring stabilized the model and dramatically improved robustness.
Calibration is something to demonstrate, not claim.
We evaluated every probability prediction generated across the tournament (2,267 prediction points) against real outcomes, achieving a mean calibration error of just 6.7 percentage points. Reporting this metric makes the model's uncertainty transparent rather than simply asserting accuracy.
Grounded AI consistently outperformed unrestricted prompting.
Rather than asking an LLM to "analyze the match," we constrained every explanation to structured event data and measured probability changes. This produced narratives that remained explainable, reproducible, and faithful to the underlying statistics.
Perhaps the most interesting football insight was that decisive moments frequently occurred long before the winning goal, reinforcing the idea that momentum shifts often originate from missed chances or tactical events rather than the final scoreline.
Challenges we ran into
The prior-shrinkage issue above was the hardest bug to diagnose because nothing visibly failed—the model simply identified the wrong decisive event. Since MatchPoint's core value is identifying the correct turning point, we added regression tests to permanently guard against this failure mode.
Counterfactuals for cards and substitutions are inherently different from shots because there is no goal outcome to reverse. Rather than invent unsupported mechanics, we transparently applied a documented ±5 percentage-point adjustment and clearly communicate this approximation within the interface.
Penalty shootouts were intentionally excluded from the model because they are not governed by open-play xG dynamics. Affected matches are clearly labeled so users understand exactly what the analysis includes.
What's next
Our immediate goal is to extend MatchPoint to the 2018 FIFA World Cup and multiple UEFA Champions League seasons using additional StatsBomb open data.
With larger datasets, we plan to quantify whether early decisive moments, missed chances, and tactical momentum shifts remain consistent across competitions.
We also want to evolve MatchPoint into a coaching decision-support tool by evaluating manager decisions—including substitutions, tactical adjustments, and formation changes—based on their measured impact on win probability.
Beyond post-match analysis, we envision MatchPoint supporting broadcast storytelling, opposition scouting, and coaching staff by providing objective evidence for the moments that truly shaped a match, helping teams learn from performances rather than simply final results.

Log in or sign up for Devpost to join the conversation.