Data pipeline
Draw histories scraped per-jurisdiction from official lottery commission sources, normalized into a SQLite warehouse, and reduced to per-(game, window, ball_kind, number) digests. Public dashboard tables (in Supabase) are refreshed nightly via cron — currently across 16 games, expanding to ~50 in Phase 5-6.
Statistical tests
- Pearson χ² with Wilson-Hilferty p-value approximation for uniformity testing against the discrete-uniform null.
- Kolmogorov-Smirnov for distributional fits (sums, range spreads, gap distributions).
- Bonferroni correction applied for the 16 games × 4 windows comparison surface (α/64 ≈ 0.00078).
- Wilson 95% CI on count proportions (Brown-Cai-DasGupta 2001; normal approximation undercovers at low counts).
- 5-fold walk-forward cross-validation for Bayesian smoothing α and Markov order selection (minimizes held-out NLL per game).
- Cover (1989) sharing-risk adjustment on strategy backtests (a real edge: avoid combinations other players cluster on).
- Percentile bootstrap 95% CI on strategy EV (skewed distributions; normal-theory undercovers).
Calibrated vs Explore modes
Calibrated mode (default) locks all statistical parameters to the per-game values minimizing held-out NLL via cross-validation. This is the scientifically defensible view.
Explore mode unlocks sliders so users can play with hot/cold thresholds, smoothing α, window length, etc. Every chart in Explore mode shows a live df-spent watermark — the count of degrees-of-freedom the user has spent fiddling. After ~3 slider moves, the watermark begins suggesting that the result is increasingly exploratory and shouldn't be treated as a calibrated finding.
Uniformity p-values across 16 games (C2)
Each dot is one game × ball kind. Bonferroni-corrected threshold accounts for 32 simultaneous tests.
Filled dots = main ball pool; hollow dots = special ball (where applicable). Dots to the left of the red Bonferroni line reject the uniform null after correcting for 32 simultaneous tests. Dots between the amber and red lines are suggestive but not corrected-significant. Several US/EU games fail uncorrected because their history mixes ball-range formats; per-format χ² results restore uniformity for every major game.
Format-mixed games
Several games have changed ball ranges during their history (Powerball 5/55 → 5/69 in 2015; Mega Millions 5/56 → 5/70 + 1/25 in 2017). When all-time χ² is computed without per-format weighting, these games fail uniformity at p < 0.05 — not because the RNG is biased, but because the format change mixes draws from different distributions. When filtered to a single format, every major game passes. The scorecard marks these as Format-mixed*.
Statistical references
- Cleveland, W. (1985). The Elements of Graphing Data.
- Tufte, E. (1990). Envisioning Information.
- Wilkinson, L. (2005). The Grammar of Graphics.
- Wilke, C. (2019). Fundamentals of Data Visualization.
- Munzner, T. (2014). Visualization Analysis and Design.
- Brown, L., Cai, T., DasGupta, A. (2001). Interval Estimation for a Binomial Proportion. Statistical Science.
- Cover, T. (1989). Do longer games favor the stronger player? AMS.
- Stern, H. (1992). Probability models for lottery games. Statistical Science.
- Suetens, S., Tyran, J.-R. (2016). The gambler's fallacy and gender. JEBO.
Spiritual tradition sources
Each widget cites its primary sources inline. Master list (Phase 3+):
- Agrippa, H.C. (1533). De Occulta Philosophia Libri Tres.
- Wilhelm, R. / Baynes, C.F. (1950). The I Ching, or Book of Changes.
- Bascom, W. (1969). Ifa Divination: Communication between Gods and Men in West Africa. (Referenced; Ifá is closed/initiation-based and not simulated in this product.)
- Aveni, A. (2001). Skywatchers (Maya).
- Tedlock, B. (1992). Time and the Highland Maya. (Living Tzolkin tradition.)
- Pingree, D. (1981). Jyotihśāstra (Vedic Jyotish).
- Ho, P.-Y. (2003). Chinese Mathematical Astrology.
Reproducibility
The complete pipeline (warehouse loaders, calibration scripts, digest builders, and dashboard push code) is at D:/dev/projects/research/lottery-datasets/calibration/ with a pytest suite covering Bug-A (REAL underflow), Bug-B (PostgREST dedupe), timeseries draw-seq invariants, and strategy field stability.