Show HN: A Monte Carlo model that called the World Cup finalists 2 weeks ago

fabioricardo72 pts0 comments

GitHub - fabio-ricardo/worldcup-forecasting-model: Hybrid Prior-Performance Monte Carlo model for forecasting FIFA World Cup knockout outcomes (paper companion code). · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

fabio-ricardo

worldcup-forecasting-model

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>3 Commits<br>3 Commits

.gitignore

.gitignore

LICENSE

LICENSE

README.md

README.md

backtests.py

backtests.py

requirements.txt

requirements.txt

worldcup_model.py

worldcup_model.py

View all files

Repository files navigation

World Cup Knockout Forecasting Model

Preprint: SSRN Working Paper No. 7013338 — https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7013338

Companion code for:

F. R. Araujo da Silva, A Hybrid Prior-Performance Monte Carlo Model for<br>Forecasting FIFA World Cup Knockout Outcomes: Methodology and Retrospective<br>Validation 1986–2026.<br>ORCID: 0000-0003-4938-5856

A transparent Monte Carlo model that forecasts the FIFA World Cup champion from<br>the first knockout round. Each team gets a strength rating blending season-long<br>priors (FIFA ranking, squad market value), group-stage performance (expected<br>goals, goals, individual production), and a goalkeeper/defensive-pedigree term.<br>Strength differences drive a Poisson goal engine with extra-time and penalty<br>resolution; the fixed bracket is simulated many times to estimate championship<br>probabilities.

No knockout-stage result is ever used as a model input.

Requirements

Python 3.8+ (standard library only — no external packages).

Usage

python worldcup_model.py # backtests (1986–2022) + 2026 prediction<br>python worldcup_model.py --loocv # also run leave-one-out cross-validation

Files

File<br>Description

worldcup_model.py<br>Model, simulation engine, backtests, prediction

data.py<br>Per-tournament inputs and fixed brackets

Method summary

Strength rating:

R_i = 1500 + 250 * (Attack_i - Defense_i)

Attack_i = 0.70*rank + 0.20*value + 0.13*xGF + 0.05*goals + 0.03*star<br>Defense_i = 0.55*xGA - 0.35*gk_pedigree

(z-scored signals; for pre-2002 tournaments rank+value are replaced by a single<br>pedigree rating carrying their combined weight.)

Match: expected goals lambda = clip(1.35 * exp(0.5*tanh((R_a - R_b)/400)), 0.25, 3.5),<br>independent Poisson draws, reduced-rate extra time, then a coin-flip shootout.

Validation

Champion in the model's top two in 10/10 tournaments, 1986–2022.

Out-of-sample (1986–1998, never used for tuning): top-two 4/4 .

Leave-one-tournament-out CV (2002–2022): top-two in 5/6 held-out folds.

Data sources

FIFA/Coca-Cola Men's World Ranking; Transfermarkt squad valuations; FIFA official<br>match statistics; published xG trackers (2010–2026, estimated for ≤1998);<br>RSSSF archive and ESPN for historical brackets and group-stage results.

License

MIT (code). Statistical data are public domain / cited to their sources.

About

Hybrid Prior-Performance Monte Carlo model for forecasting FIFA World Cup knockout outcomes (paper companion code).

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Python<br>100.0%

You can’t perform that action at this time.

model world fifa forecasting knockout reload

Related Articles