How songalobung/footsim works
FootSim is a football match simulation and prediction suite. Its main workflow loads and normalizes historical match data, fits goal and event models, simulates matches minute by minute, then answers market queries from the shared simulations. Separate product branches cover squad and live-match adjustments, pre-match inspection, and walk-forward, calibration, statistical-significance, and betting analysis. The README documents the broader capabilities; sampled source and the SOURCE INDEX support the implementation links shown. Unsampled modules are represented at directory level where appropriate.
Main entry points: cli.py FootSim CLI · backtest.py Walk-Forward Backtest · match.py Match Simulator · dixon_coles.py Dixon-Coles Model
Components 24
Match Data
- Load & Normalize
footsim/data/loader.py - Historical Matches
footsim/data/loader.py - EWMA Ratings
footsim/data/ewma.py
Prediction Models
- Dixon-Coles Model
footsim/goals/dixon_coles.py - Goal Dependence
footsim/goals/copula.py - Event Rates
footsim/events/rates.py
Simulation
- Match Simulator
footsim/sim/match.py - Simulation Config
footsim/sim/config.py - Squad & Absences
footsim/sim/squad.py - Player Events
footsim/sim/players.py - Live Simulation
footsim/sim/inplay.py - Market Queries
footsim/markets/query.py
Inspection & Evaluation
- Match Inspection
footsim/eval/inspection.py - Walk-Forward Backtest
footsim/eval/backtest.py - Betting & Edge
footsim/eval/betting.py - Calibration
footsim/eval/calibration.py - Significance Tests
footsim/eval/significance.py - Evaluation Metrics
footsim/eval/metrics.py - Odds & Devigging
footsim/eval/odds.py - Event Evaluation
footsim/eval/events.py
Other components
- CLI User
- FootSim CLI
footsim/cli.py - Match Data Source
- Pinnacle Closing Odds
Connections 35
- CLI User → FootSim CLI: runs commands
README.md - FootSim CLI → Load & Normalize: loads matches
footsim/cli.py - Match Data Source → Load & Normalize: provides season CSVs
footsim/data/loader.py - Load & Normalize → Historical Matches: normalizes and caches
footsim/data/loader.py - FootSim CLI → Dixon-Coles Model: fits model
footsim/cli.py - FootSim CLI → Event Rates: fits rates
footsim/cli.py - Dixon-Coles Model → EWMA Ratings: uses ratings
footsim/goals/dixon_coles.py - FootSim CLI → EWMA Ratings: configures ratings
- Dixon-Coles Model → Historical Matches: fits from matches
README.md - Event Rates → Historical Matches: fits from matches
README.md - FootSim CLI → Match Simulator: runs prediction
footsim/cli.py - Dixon-Coles Model → Match Simulator: supplies goal model
README.md - Event Rates → Match Simulator: supplies event rates
README.md - Simulation Config → Match Simulator: configures run
footsim/sim/match.py - Squad & Absences → Match Simulator: adjusts teams
footsim/sim/match.py - Player Events → Match Simulator: attributes events
footsim/sim/match.py - Match Simulator → Live Simulation: supports live mode
- Match Simulator → Market Queries: produces query inputs
README.md - FootSim CLI → Market Queries: queries markets
footsim/cli.py - FootSim CLI → Match Inspection: runs inspection
footsim/cli.py - Match Inspection → Historical Matches: audits match form
footsim/eval/inspection.py - FootSim CLI → Walk-Forward Backtest: runs backtest
footsim/cli.py - Walk-Forward Backtest → Historical Matches: evaluates match history
footsim/eval/backtest.py - Walk-Forward Backtest → Dixon-Coles Model: refits per block
footsim/eval/backtest.py - Walk-Forward Backtest → Odds & Devigging: removes odds margin
footsim/eval/backtest.py - Pinnacle Closing Odds → Walk-Forward Backtest: benchmarks predictions
README.md - FootSim CLI → Betting & Edge: runs betting analysis
footsim/cli.py - Walk-Forward Backtest → Betting & Edge: evaluates wagers
footsim/eval/backtest.py - Walk-Forward Backtest → Calibration: produces calibration
footsim/eval/backtest.py - Walk-Forward Backtest → Evaluation Metrics: scores forecasts
footsim/eval/backtest.py - Walk-Forward Backtest → Significance Tests: tests benchmarks
footsim/eval/backtest.py - FootSim CLI → Event Evaluation: evaluates events
footsim/cli.py - Event Evaluation → Event Rates: scores event rates
footsim/eval/events.py - Significance Tests → Evaluation Metrics: uses metrics
footsim/eval/significance.py - Dixon-Coles Model → Goal Dependence: uses dependence model
footsim/goals/dixon_coles.py