Skip to main content
Methodology

How we calibrate

Every chart on PatternSight is reproducible from public draw histories + published statistical tests. This page documents the exact procedures and references.

What PatternSight does — and what it cannot do

A fair lottery is, by design, maximally random. Uniform draw probabilities maximize Shannon entropy — the mathematical way of saying no number is more likely than any other and the draw carries no exploitable signal. Our default belief about every game is therefore fairness: absent strong evidence to the contrary, the forecast for every number stays uniform. We never inject a preference for a number because it is "due" or "running hot" — that would mean inventing information the data does not contain.

PatternSight is a quantitative research terminal for lottery analytics: distributions with quantified uncertainty, calibration against actual frequencies, bias and anomaly detection, and ROI backtests against random — all with mandatory multiple-comparison correction. It does not predict which numbers will win, and it never claims to improve your odds. In many jurisdictions, claiming you can predict gambling outcomes is a consumer-protection violation, not just a credibility risk. What you do with the numbers, and the outcomes, are yours.

Why our backtest edge is ≈ 1.0 — and why that is correct

A lift of ≈ 1.0 (no edge over random) is not a bug we tune away; it is what theory predicts. Three independent reasons: (1) the entropy maximum — a fair draw has no signal to extract; (2) the Cramér-Rao bound— detecting a bias as small as p = 0.105 vs 0.095 would need impractically many draws, so small-sample "edges" are statistical noise; (3) our own complexity gate — if an advanced model does not beat a plain Dirichlet-Multinomial baseline after correction, we demote it. Order of magnitude: detecting a 1%-high number in a 6/49 game needs roughly 20,000 draws; a Pick-3 digit bias roughly 5,000. Most games never accumulate that history.

Two rigor rules follow. Correct null for the game type: for without-replacement games (6/49-style) the naive χ² distribution does not apply — the asymptotic null is a weighted sum of χ² variables (Genest et al. 2002), so we calibrate those p-values by permutation rather than reading a standard χ² table. Multiple-testing control: across hundreds of games × numbers × features we run a very large number of implicit tests, so every anomaly claim must survive Benjamini-Hochberg FDR or Bonferroni correction. A single isolated hot number is never evidence.

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-spentwatermark — 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 498 games (C2)

Each dot is one game × ball kind. Bonferroni-corrected threshold accounts for 996 simultaneous tests.

Cannot reject (p ≥ 0.05): 454Marginal: 21Bonferroni-rejected: 30

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 996 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.
  • Shannon, C. (1948). A Mathematical Theory of Communication. Bell System Technical Journal. (Entropy is maximized by the uniform distribution.)
  • Genest, C., et al. (2002). Goodness-of-fit tests for discrete distributions. (Weighted-χ² null for without-replacement draws.)
  • Benjamini, Y., Hochberg, Y. (1995). Controlling the False Discovery Rate. JRSS-B.
  • 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.

Back to Stats Lab