Do models beat the closing line? Not in the NBA or NFL
Elo, state-space and machine-learning models for NBA and NFL games, tested against Kalshi, Polymarket and sportsbook closing prices. The markets win.
- Out-of-sample NBA games
- 14,338
- Best NBA model vs Kalshi close
- 0.016 log loss worse (1,556 games)
- Day-ahead bets vs the close
- +1.06 points, less than the fee
- Props signal, scored as settled
- Weight 0.02 (SE 0.05)
- Python
- pandas
- LightGBM
- statsmodels
- SQLite

Sports betting markets are a clean test of market efficiency: every contract settles on an observable result within hours. I built probability models for NBA and NFL games from public data and asked whether they disagree with market prices in ways the outcomes vindicate. The yardstick is out-of-sample forecast accuracy, not backtest returns.
How it works #
- Data. NBA and NFL results, box scores and official injury reports with publication times, NFL sportsbook closing lines, and order-book price histories from Kalshi and Polymarket. Everything sits in a SQLite odds database with UTC timestamps for every quote and report.
- Models. Elo with FiveThirtyEight’s settings as the benchmark, Glicko-2, Poisson, a Bayesian state-space model with exact Kalman filtering, player-availability and starting-quarterback adjustments, walk-forward logistic regression and gradient boosting, and an ensemble. Market prices become probabilities with the bookmaker’s margin removed (“devigged”), by five methods.
- Leakage controls. Ratings use only earlier days’ results, injury reports count only if published before the decision time, and backtests buy the ask available at that time. Tests perturb future results, late injury reports and closing prices, and check that no earlier decision changes.
What I found #
| Comparison | Games | Result |
|---|---|---|
| Best NBA model (an ensemble) vs Elo | 14,338 | 0.016 lower log loss (95% CI 0.013 to 0.019) |
| The same ensemble vs Kalshi’s closing price | 1,556 | 0.016 higher log loss (95% CI 0.008 to 0.023) |
| Best NFL model vs devigged sportsbook close | 3,685 | 0.013 higher log loss (95% CI 0.008 to 0.019) |
Log loss scores probability forecasts; lower is better. The closing price also encompasses the models: in a regression on both, the ensemble’s weight is −0.10 (SE 0.17). Schedule, fatigue and late injury news matter, and the market prices them. None of 24 tests on the Kalshi and Polymarket closes finds anything left over after a multiple-testing correction.

The one inefficiency comes a day before the game. Bets placed 24 hours out beat the closing price by +1.06 points on average (95% CI +0.72 to +1.40), but Kalshi’s taker fee is larger, and pre-registered quarter-Kelly strategies lose money after costs. A rule that learns how much weight the model deserves next to the price mostly abstains: 122 bets in 1,265 eligible games.
A replication that passed, then failed. A player-points model seemed to add information to Kalshi prop prices. I pre-registered a replication before downloading new data, and on 728 held-out games it passed as registered (one-sided p = 0.0005). A post-hoc check then traced the signal in both samples to a scoring error: props on players who sat out were scored as losses, while Kalshi settles them at a pre-game fair price. Scored the way the markets settle, the model’s weight is 0.02 (SE 0.05) and every prop trading rule loses money. Pre-registration guards against selective analysis, not against an error shared by discovery and replication. Outcomes now come from the venue’s own settlement by default.
Limits #
- NBA exchange prices cover parts of three seasons. The one free NBA sportsbook archive forbids use without consent, so it was left out.
- Polymarket backtests assume no fee and a one-point half-spread.
- Tip-off times, NFL starting quarterbacks and game-time wind are approximations, flagged where they enter.
- The props samples are out of sample in games but not in time: both cover January to November 2026.
How it’s built #
A Python library with modules for data, the odds database, market conversion, models, evaluation (proper scoring rules, calibration, paired tests, encompassing regressions, multiple-testing corrections) and an event-driven bankroll simulator with fees and liquidity caps. Every number in the paper is regenerated from dated raw files, and the registered props code is frozen byte for byte with its hashes. The downloaded data and the dashboard stay out of the public repository, because they would republish the exchanges’ prices.