M1-045M1: Mathematics & Statistics FundamentalsHypothesis TestingHard
⚡Flashcard Drill➔Mastery:

Explain Sequential Testing and the Peeking Problem, and Detail Correct Continuous Monitoring Frameworks

📐 Mathematical Definition
alpha spending: α(t) 随累计信息量分配,∑α(t)=α\text{alpha spending}:\ \alpha(t)\ \text{随累计信息量分配,}\sum\alpha(t)=\alpha
⚡ One-Sentence Core Answer
The Peeking Problem occurs when continuously checking p-values and stopping once p<0.05p<0.05, which inflates false positive rates from 5% to over 30%; resolved via alpha spending or sequential probability ratio tests.

📌 Key Takeaways

  • •
    The Peeking Problem: Repeatedly evaluating fixed-horizon tests over time turns the decision into sup⁡t≤TZt\sup_{t \le T} Z_t, guaranteeing eventual false positive crossing by the Law of Iterated Logarithm.
  • •
    Alpha Spending Function (Lan-DeMets / Pocock / O'Brien-Fleming): Allocates portions of total significance budget α\alpha across intermediate evaluation points.
  • •
    Always-Valid Inference (mSPRT / e-values): Constructs nonnegative supermartingales allowing arbitrary, continuous real-time peeking without inflating Type I error.

📐 Mathematical Derivations

Law of the Iterated Logarithm (LIL): For standardized random walk Sn=∑i=1nXiS_n = \sum_{i=1}^n X_i, lim sup⁡n→∞Sn2nlog⁡log⁡n=1\limsup_{n\to\infty} \frac{S_n}{\sqrt{2n \log \log n}} = 1 almost surely under H0H_0. Because 2nlog⁡log⁡n→∞\sqrt{2n \log \log n} \to \infty, the sample path will cross any fixed threshold z1−α/2nz_{1-\alpha/2} \sqrt{n} with probability 1 as n→∞n\to\infty. Hence, peeking daily for 30 days inflates effective α\alpha to ≈30%\approx 30\%. The Mixture Sequential Probability Ratio Test (mSPRT, Johari et al., 2017) computes test statistic Λn=∫∏i=1np(xi∣θ)p(xi∣0)dH(θ)\Lambda_n = \int \prod_{i=1}^n \frac{p(x_i\mid \theta)}{p(x_i\mid 0)} dH(\theta). By Ville's inequality for supermartingales, P(∃n:Λn≥1/α∣H0)≤αP(\exists n : \Lambda_n \ge 1/\alpha \mid H_0) \le \alpha, guaranteeing valid inference at all stopping times.

🏭 Production Trade-offs

Standard fixed-horizon A/B testing forbids inspecting results before reaching the planned sample size NN. However, product teams want to stop losing experiments early to minimize revenue destruction. Modern platforms (Optimizely, Netflix, Uber) implement mSPRT or O'Brien-Fleming boundaries, enabling continuous monitoring dashboards with rigorous statistical guarantees at the cost of slightly higher average sample size.
⚠️ Common Interview Pitfalls
  • ✕
    Checking the A/B dashboard every morning and turning off the experiment the moment p<0.05p < 0.05.
  • ✕
    Treating standard confidence intervals as valid when early stopping rules were applied.
🎯 Interviewer Follow-up Inquiries
  • ?
    How does Ville's inequality for nonnegative supermartingales provide time-uniform confidence boundaries?
  • ?
    What is the difference between Pocock boundaries (constant threshold) and O'Brien-Fleming boundaries (conservative early on)?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

Explore the comprehensive technical article, exam cards, and global architecture tree.

← PreviousM1-044: Define the Multiple Testing Problem and Contrast Common Corrections (Bonferroni vs. Benjamini-Hochberg FDR)📋Back to BankNext →M1-046: Explain the Frequentist Interpretation of Confidence Intervals and Their Duality with Hypothesis Testing
中文速览与面试要点

什么是序贯检验与 peeking 问题?如何正确做序贯实验。

反复查看并随时停止会极大抬高假阳性;需用 alpha-spending 或 always-valid 方法。

核心要点

  • peeking 问题的数学本质:经典假设检验的 α 是 一次性 检验的假阳性率,其推导假设检验只做一次。若在数据累积过程中反复检验并在任一次显著时停止(optional stopping),假阳性率会随检验次数单调上升——对布朗运动式的随机游走,连续监控下的最终假阳性率趋向 1 (因为随机游走几乎必然会在某个时刻越过任意有限阈值)。直觉上,这相当于把'一次抽样'变成'多次抽样取最大',而最大值的分布远比单次抽样极端。这是 A/B 测试中'跑三天看到显著就上线'的经典陷阱。
  • 三类正确做法:① 固定时长/固定样本量 ——最简单的解法,预先用功效分析定 n,跑满再分析一次;缺点是无法提前止损(若效应明显为负也只能跑完)。② Group Sequential(分组序贯) ——预先指定 k 次中期分析,用 alpha-spending 函数(如 O'Brien-Fleming)分配 α 预算,早期检验用更严阈值(因为早期数据少、波动大),总 α 仍为 0.05。这是临床试验的标准做法。③ Always-valid 推断 ——用 mSPRT (混合序贯概率比检验)或 confidence sequences 构造在任何停止时刻都有效的置信区间,可随时查看而不失真;代价是区间略宽(功效略低)。补充说明: 贝叶斯 A/B 在一定程度上规避该问题 ——后验随数据更新是合法的,P(p_A>p_B) 不会因反复查看而系统性失真(但若用后验做频繁的'上线/不上线'决策仍需考虑预期损失)。
  • 固定时长实验是简单解法
  • Sequential test / group sequential / mSPRT 允许安全 peeking

常见陷阱

  • 跑几天看到显著就停止(peeking 导致假阳性膨胀)
  • 认为贝叶斯方法完全无需考虑停止规则