M1-049M1: Mathematics & Statistics FundamentalsConfidence Intervals & BootstrapMedium
⚡Flashcard Drill➔Mastery:

Contrast Bootstrap vs. Permutation Tests and Detail Their Respective Valid Assumptions and Use Cases

📐 Mathematical Definition
permutation:shuffle labels⇒null distribution\text{permutation}: \text{shuffle labels} \Rightarrow \text{null distribution}
⚡ One-Sentence Core Answer
Bootstrap resamples with replacement to estimate estimation uncertainty (confidence intervals); Permutation tests shuffle group labels without replacement to evaluate the sharp null hypothesis of identical distributions.

📌 Key Takeaways

  • •
    Bootstrap: Resamples with replacement (NN from NN) under general population model; primary goal is Confidence Intervals and standard errors.
  • •
    Permutation test: Shuffles labels without replacement under exchangeability assumption; primary goal is Exact P-values for hypothesis testing.
  • •
    Exchangeability: Permutation strictly requires that under H0H_0, observations across treatment and control are identically distributed and swappable.

📐 Mathematical Derivations

Permutation test mechanics: Testing H0:FA=FBH_0: F_A = F_B against H1:FA≠FBH_1: F_A \ne F_B with observed statistic Tobs=XˉB−XˉAT_{\text{obs}} = \bar{X}_B - \bar{X}_A. Under H0H_0, group labels ('Treatment' vs 'Control') are arbitrary. Pool all NA+NBN_A + N_B observations together. For p=1,…,Pp = 1, \dots, P: randomly shuffle the combined labels, reassign NAN_A points to pseudo-group AA and NBN_B points to pseudo-group BB, and compute T∗p=XˉB∗p−XˉA∗pT^{*p} = \bar{X}_B^{*p} - \bar{X}_A^{*p}. The exact two-sided p-value is p=1+∑p=1PI(∣T∗p∣≥∣Tobs∣)P+1p = \frac{1 + \sum_{p=1}^P \mathbb{I}(|T^{*p}| \ge |T_{\text{obs}}|)}{P + 1}. The added '1' in numerator and denominator ensures valid, non-zero exact frequentist type I error control.

🏭 Production Trade-offs

Practical selection guidelines: (1) Use Permutation Tests when sample size is small, distribution is completely unknown/skewed, and you require an exact, distribution-free p-value testing whether treatment has zero effect. (2) Use Bootstrap when you need to construct confidence intervals around treatment effect Δ\Delta, quantify estimation uncertainty, or compute ratios/quantiles.
⚠️ Common Interview Pitfalls
  • ✕
    Using permutation tests when group variances differ under the null hypothesis (Behrens-Fisher problem invalidates exchangeability, causing inflated false positives).
  • ✕
    Using sampling with replacement in a permutation test (which turns it into a bootstrap test).
🎯 Interviewer Follow-up Inquiries
  • ?
    Why does the permutation test provide an exact finite-sample test while bootstrap provides only asymptotic guarantees?
  • ?
    How can permutation tests be applied to test independence between two continuous variables?
⚡
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-048: Compare the Three Standard Bootstrap Interval Construction Methods (Percentile, Normal, and BCa Intervals)📋Back to BankNext →M1-050: Detail How to Apply Bootstrap to Evaluate Statistical Significance in A/B Testing and Identify Key Pitfalls
中文速览与面试要点

bootstrap 与置换检验(permutation test)分别适用于什么场景?

bootstrap 估计统计量的抽样分布(可给 CI);置换检验在 H0 下构造零分布(给 p 值)。

核心要点

  • 两者的 目的与假设不同 : Bootstrap 通过有放回重采样估计统计量的 抽样分布 ,用途是构造置信区间、估计标准误;它不对 H₀ 作假设,模拟的是'从总体再抽样'。 Permutation test 通过随机打乱分组标签(保持各组样本量与数据值不变)构造 H₀ 下的零分布 ,用途是计算 p 值;其有效性依赖 可交换性 (exchangeability)——即 H₀ 为真时,样本的分组标签是可交换的(任意排列同样可能)。两者的共同优势是 无需分布假设 (不依赖正态性),适合小样本与非常规统计量。
  • 选择与陷阱:① 目的驱动选择 ——要区间用 bootstrap,要 p 值用 permutation;两者可以互补(先 permutation 得 p 值,再 bootstrap 得效应量 CI)。② 置换检验的适用边界 ——要求处理分配与样本独立(如随机化实验);对 观察性数据 ,若两组在混杂变量上不可交换,置换检验的零分布不再有效,此时需条件置换(在协变量层内置换)或用倾向性加权。③ 依赖结构的破坏 ——时间序列(自相关)与聚类数据(用户内相关)打乱标签会破坏依赖结构,需用 block permutation 或 cluster permutation。④ A/B 测试中的重尾指标 ——两种方法都可用,但 permutation 对极值更稳健(因为它不依赖重采样复现尾部),实践中常先做 CUPED 降方差再检验;若指标是比率型(CTR),permutation 直接对用户级聚合值置换即可,无需正态假设。
  • 置换检验要求可交换性(H0 下分组无差异)
  • 两者都无需正态假设

常见陷阱

  • 对观察性数据直接用置换检验(违反可交换性)
  • 混淆 bootstrap(估分布)与 permutation(构零分布)的用途