Skip to main content

Win expectancy (wexp)

The pregame win-expectancy harness for the NFL and college football: market oracles (vig-removed closing probabilities), baselines, rating engines (Elo, ridge, Glickman-Stern), a vintage-keyed feature store that joins each game to the vintage for its week, the walk-forward backtest, scoring, and post-game deserved-win estimates.

Models and calculators​

FunctionSummary
EloConfigTunable Elo parameters (all seeds, none sacred).
GSConfigGlickman-Stern state-space tunables (Axis A6; all seeds, none sacred).
VariantConfigOne point in the variation matrix (validated on construction).
VintageStoreIn-memory registry of vintage-keyed feature frames.
append_resultsAppend result rows to the append-only leaderboard parquet.
baseline_probsAppend baseline probability columns to a market-oracle frame.
brier_scoreMean squared error between predicted probabilities and binary outcomes.
build_cfb_market_oracleLoad the cfb_line_odds archive + ESPN schedules and build the CFB oracle.
build_nfl_market_oracleLoad nflverse schedules and build the NFL market oracle.
build_predictorDispatch a variant config to its implemented week predictor.
calibration_tableBucket predicted probabilities into bins and compare to actual outcome rates.
carry_forward_weightsHow much of last season's metrics to still believe, by team and week.
cfb_continuity_shiftsCompile CFB talent + returning production into Elo prior shifts (Axis D3).
cfb_drive_deltasPer-drive EP deltas from play-by-play (the shared drive substrate).
cfb_drive_ep_responsesPer team-game drive-EP efficiency from play-by-play (both sides rated).
cfb_market_oracle_from_linesBuild the CFB market oracle from the cfb_line_odds archive + schedules.
closing_line_valueMean closing line value captured by betting the model's disagreements.
devig_multiplicativeRemove vig by normalizing raw implied probabilities to sum to 1.
devig_shinRemove vig with Shin's method (insider-trading model).
eceExpected calibration error: n-weighted mean |mean_pred - mean_actual| per bin.
elo_predictorWrap the margin-Elo engine (Axis A1) as a week predictor.
elo_ratingsWalk games chronologically and emit pre-game Elo ratings + P(home).
enumerate_variantsGenerate the pruned axis cross-product.
favorite_bucket_tableFPI-style calibration buckets from the favorite's perspective.
glickman_stern_predictorWrap the Glickman-Stern (1998) Kalman filter as a week predictor.
log_loss_scoreBinary cross-entropy loss between predicted probabilities and outcomes.
logit_blendBlend two probabilities in logit space (70/30 by default).
maeMean absolute error between two arrays.
moneyline_pair_probVig-removed home win probability from a two-way American moneyline pair.
net_vintages_viewAdapt a net-rating vintage table to the ratings_predictor contract.
nfl_market_oracle_from_scheduleBuild the NFL market oracle from an nflverse schedule frame.
postgame_weDeserved-win probability per game from per-drive EP deltas.
prob_from_americanConvert an American moneyline price to its raw implied probability.
prob_from_decimalConvert a decimal (European) price to its raw implied probability.
ratings_predictorWrap a registered ratings vintage table as a week predictor.
response_ridge_vintagesWeekly opponent-adjusted ridge on per-team-game responses (off + def).
result_rowsBuild long-format result rows (one row per metric) for the leaderboard.
ridge_margin_vintagesBuild per-week opponent-adjusted ridge rating vintages from an oracle frame.
run_backtestWalk an oracle frame forward week by week and score the predictions.
score_baselinesScore every p_* baseline column per season and pooled.
score_probsScore one probability column per season and pooled into result rows.
sos_sor_vintagesAs-of strength of schedule + strength of record, per team per week.
spearman_corrSpearman rank correlation between two arrays.
spread_to_probMap an expected home margin to a home win probability via a normal CDF.
variant_hashStable 12-hex identifier for a variant config.
winner_accuracyFraction of games where the model's favorite (p >= 0.5) won.