srm_test.py |
Sample Ratio Mismatch (χ²) |
catches bucketing/traffic bugs before any downstream test |
sample_size.py |
Fixed-horizon sizing |
n/arm for proportions and means |
delta_method_ratio.py |
Ratio metrics (CTR, RPC) |
correct SE for ΣY/ΣX; the naive per-unit t-test is biased |
ratio_cuped.py |
CUPED on a ratio metric |
linearise Z = Y − R·X: pre-period data cuts SE without new sample |
cuped.py |
Variance reduction |
variance ↓ by ρ², SE by ~ρ, using pre-period data |
cupac.py |
CUPAC |
OLS over every pre-period column removes more variance than one covariate |
post_stratification.py |
Post-stratification |
repairs a drifted split using pre-registered strata |
group_sequential.py |
Alpha-spending boundaries |
Pocock/OBF control Type I while naive peeking inflates it |
msprt_always_valid.py |
Always-valid p-values |
mSPRT lets you peek and stop any time, validly |
sequential_ratio.py |
Sequential ratio metrics |
delta-method + mSPRT for CTR under continuous monitoring |
sequential_ab_testing.py |
Evan Miller’s sequential rule |
reproduces the size table, validates Type I/power, sample savings |
bayesian_ab_test.py |
Analytic Bayesian A/B |
Beta-Binomial / Normal-Normal, P(B>A), expected loss, ROPE |
bootstrap_ci.py |
Bootstrap CIs |
percentile & BCa for skewed metrics |
heterogeneous_treatment_effects.py |
HTE by segment |
interaction model reveals Simpson-paradox-like cancellation |
multiple_comparisons.py |
Multiple-testing correction |
Bonferroni (FWER) vs Benjamini-Hochberg (FDR) |
novelty_primacy.py |
Time-varying effects |
treat×day interaction detects novelty decay / primacy growth |
switchback.py |
Cluster & switchback designs |
cluster-robust SE; naive over-/under-rejects; carryover bias |
test_simulator.py |
Generic test calibration |
plug any DGP + test → empirical Type I and power curve |