M1-080M1: Mathematics & Statistics FundamentalsHypothesis TestingHard
⚡Flashcard Drill➔Mastery:
Explain Bayes Factors and the Bayesian Perspective on Hypothesis Testing
📐 Mathematical Definition
⚡ One-Sentence Core Answer
The Bayes Factor quantifies the relative evidence provided by observed data in favor of hypothesis over , naturally penalizing overparameterized models via Occam's razor.
📌 Key Takeaways
- •Bayesian Updating: ; Posterior Odds = Bayes Factor Prior Odds.
- •Marginal Likelihood: ; integrates out all internal model parameters.
- •Evidence Scale (Jeffreys): (substantial), (strong), (decisive evidence for ).
📐 Mathematical Derivations
From Bayes' theorem applied directly to competing model hypotheses: and . Taking the ratio cancels the intractable overall evidence : . The Bayes factor is . Unlike frequentist tests, evaluates evidence symmetrically: provides direct evidence in favor of the null hypothesis , resolving the fundamental frequentist limitation of never being able to accept .
🏭 Production Trade-offs
Occam's Razor mechanism: Complex models with broad prior parameter spaces spread their prior density thin over large volumes. Unless the data strongly requires that flexibility, the marginal likelihood penalizes complex models compared to parsimonious ones. In production Bayesian A/B testing, platforms compute directly, communicating intuitive actionable probabilities to product managers.
⚠️ Common Interview Pitfalls
- ✕Lindley's Paradox: For large sample size , a result can be highly statistically significant in frequentist terms () while the Bayes Factor decisively favors the null hypothesis ().
- ✕Using overly wide, vague priors in Bayes factor calculations, which artificially drives (Bartlett's paradox).
🎯 Interviewer Follow-up Inquiries
- ?What is Lindley's Paradox and why does frequentist rejection diverge from Bayesian evidence as sample size ?
- ?How does the Bayesian Information Criterion (BIC) approximate asymptotically?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚
Associated Knowledge Base Guides & Mindmaps
Explore the comprehensive technical article, exam cards, and global architecture tree.
中文速览与面试要点
解释贝叶斯因子与假设检验的贝叶斯视角。
贝叶斯因子 = 两假设下数据的边际似然比;同时支持两个方向,不受'不能证明 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₀ 的支持)
- 忽略贝叶斯因子对先验的敏感性