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

Explain Bayes Factors and the Bayesian Perspective on Hypothesis Testing

📐 Mathematical Definition
BF10=p(D∣H1)p(D∣H0)=∫p(D∣θ,H1)p(θ∣H1)dθ∫p(D∣θ,H0)p(θ∣H0)dθBF_{10}=\frac{p(D\mid H_1)}{p(D\mid H_0)}=\frac{\int p(D\mid\theta,H_1)p(\theta\mid H_1)d\theta}{\int p(D\mid\theta,H_0)p(\theta\mid H_0)d\theta}
⚡ One-Sentence Core Answer
The Bayes Factor BF10=p(D∣H1)p(D∣H0)BF_{10} = \frac{p(D\mid H_1)}{p(D\mid H_0)} quantifies the relative evidence provided by observed data in favor of hypothesis H1H_1 over H0H_0, naturally penalizing overparameterized models via Occam's razor.

📌 Key Takeaways

  • •
    Bayesian Updating: P(H1∣D)P(H0∣D)=BF10×P(H1)P(H0)\frac{P(H_1\mid D)}{P(H_0\mid D)} = BF_{10} \times \frac{P(H_1)}{P(H_0)}; Posterior Odds = Bayes Factor ×\times Prior Odds.
  • •
    Marginal Likelihood: p(D∣Hk)=∫p(D∣θk,Hk)p(θk∣Hk)dθkp(D\mid H_k) = \int p(D\mid \theta_k, H_k) p(\theta_k\mid H_k) d\theta_k; integrates out all internal model parameters.
  • •
    Evidence Scale (Jeffreys): BF10>3BF_{10} > 3 (substantial), >10> 10 (strong), >100> 100 (decisive evidence for H1H_1).

📐 Mathematical Derivations

From Bayes' theorem applied directly to competing model hypotheses: P(H1∣D)=p(D∣H1)P(H1)p(D)P(H_1\mid D) = \frac{p(D\mid H_1)P(H_1)}{p(D)} and P(H0∣D)=p(D∣H0)P(H0)p(D)P(H_0\mid D) = \frac{p(D\mid H_0)P(H_0)}{p(D)}. Taking the ratio cancels the intractable overall evidence p(D)p(D): P(H1∣D)P(H0∣D)=(p(D∣H1)p(D∣H0))(P(H1)P(H0))\frac{P(H_1\mid D)}{P(H_0\mid D)} = \left(\frac{p(D\mid H_1)}{p(D\mid H_0)}\right) \left(\frac{P(H_1)}{P(H_0)}\right). The Bayes factor is BF10=∫p(D∣θ1,H1)p(θ1∣H1)dθ1∫p(D∣θ0,H0)p(θ0∣H0)dθ0BF_{10} = \frac{\int p(D\mid \theta_1, H_1) p(\theta_1\mid H_1)d\theta_1}{\int p(D\mid \theta_0, H_0) p(\theta_0\mid H_0)d\theta_0}. Unlike frequentist tests, BF10BF_{10} evaluates evidence symmetrically: BF10<1/3BF_{10} < 1/3 provides direct evidence in favor of the null hypothesis H0H_0, resolving the fundamental frequentist limitation of never being able to accept H0H_0.

🏭 Production Trade-offs

Occam's Razor mechanism: Complex models with broad prior parameter spaces spread their prior density p(θ∣H1)p(\theta\mid H_1) thin over large volumes. Unless the data strongly requires that flexibility, the marginal likelihood ∫p(D∣θ)p(θ)dθ\int p(D\mid \theta)p(\theta)d\theta penalizes complex models compared to parsimonious ones. In production Bayesian A/B testing, platforms compute P(Lift>0∣D)P(\text{Lift} > 0\mid D) directly, communicating intuitive actionable probabilities to product managers.
⚠️ Common Interview Pitfalls
  • ✕
    Lindley's Paradox: For large sample size NN, a result can be highly statistically significant in frequentist terms (p<0.001p < 0.001) while the Bayes Factor decisively favors the null hypothesis (BF01≫100BF_{01} \gg 100).
  • ✕
    Using overly wide, vague priors in Bayes factor calculations, which artificially drives BF10→0BF_{10} \to 0 (Bartlett's paradox).
🎯 Interviewer Follow-up Inquiries
  • ?
    What is Lindley's Paradox and why does frequentist rejection diverge from Bayesian evidence as sample size N→∞N \to \infty?
  • ?
    How does the Bayesian Information Criterion (BIC) approximate −2log⁡p(D∣Hk)-2 \log p(D\mid H_k) asymptotically?
⚡
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-079: Define Two One-Sided Tests (TOST) for Equivalence and How It Differs from Standard Null Hypothesis Testing📋Back to BankNext →M1-081: Explain the Delta Method and Its Mathematical Conditions for Ratio Metric Asymptotic Variance
中文速览与面试要点

解释贝叶斯因子与假设检验的贝叶斯视角。

贝叶斯因子 = 两假设下数据的边际似然比;同时支持两个方向,不受'不能证明 H0'的限制。

核心要点

  • 贝叶斯因子的定义是 两个假设下数据的边际似然之比 (也称'证据比'):BF₁₀=p(D|H₁)/p(D|H₀),其中每个边际似然是对该假设下先验积分 ∫p(D|θ)p(θ)dθ。 与 p 值的四个关键差异 :① 双向性 ——BF 既能支持 H₁(BF>1)也能支持 H₀(BF 不依赖停止规则 ——贝叶斯推断基于后验(似然 × 先验),无论你何时停止观察,后验更新都是合法的,故 BF 天然免疫 peeking 问题 (这是贝叶斯方法在 A/B 测试中的主要吸引力);③ 不受'样本量无上限'困扰 ——p 值随 n 增大必然变小(即使效应微小),而 BF 会收敛到'真实假设'的支持(若 H₀ 真,BF→0);④ 可直接转为后验概率 ——P(H₁|D)=BF·P(H₁)/(BF·P(H₁)+P(H₀)),给出'假设为真的概率'这一直觉性结论。 解读标度 (Jeffreys):BF>10 强证据、>30 很强、>100 极强;BF<1/10 则支持 H₀。
  • 实践要点与局限:① 对先验敏感 ——BF 依赖 H₁ 下参数的先验分布(如效应量的先验宽度);先验过于弥散会使 BF 偏向 H₀('Bartlett 悖论'),过于集中则偏向 H₁;故应做 先验敏感性分析 并优先用 默认/客观先验 (如 Jeffreys-Zellner-Siow 先验、Cauchy 先验)。② 计算困难 ——边际似然需对参数积分(通常无解析解),需 MCMC、bridge sampling、或 Savage-Dickey 密度比(对嵌套模型)等方法。③ A/B 测试中的应用 ——贝叶斯 A/B 直接报告 P(新方案更好) 与 预期损失 ,且允许随时查看(无 peeking 惩罚),这是许多工业界 A/B 平台采用贝叶斯方法的原因;但需注意'随时查看并决策'仍会累积决策错误(决策理论层面),只是不再是经典的 α 膨胀。④ 与常规检验的关系 ——两者回答不同问题:p 值回答'数据在原假设下有多罕见',BF 回答'哪个假设更能解释数据';报告两者能提供更完整的信息。⑤ 实践建议 ——若需'证明无差异'或'随时查看',贝叶斯方法更合适;若需与既有文献/监管框架对接,频率派方法仍是主流。
  • BF>1 支持 H1,BF<1 支持 H0(可量化支持 H0 的证据)
  • 与 p 值不同:BF 不依赖停止规则(无 peeking 问题)

常见陷阱

  • 用 p 值'证明' H₀(贝叶斯因子才能量化对 H₀ 的支持)
  • 忽略贝叶斯因子对先验的敏感性