# 贝叶斯定理

**贝叶斯定理**是概率论中的一条规则，它把一个条件概率转换为它的逆概率：它说明如何从“给定原因时结果的概率”\( P(A|B) \)连同两个事件的无条件概率，计算出“给定结果时原因的概率”\( P(B|A) \)。在统计学中，它是把先验知识与当前数据结合起来产生后验分布的数学工具，贝叶斯推断即由此得名。<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup><sup> • </sup><sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup>

| 关键事实 | 详情 |
|---|---|
| 表述 | 对于满足 \( P(A) \neq 0 \) 的事件 \( A \) 与 \( B \)，\( P(B|A) = \dfrac{P(A|B)P(B)}{P(A)} \)<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup> |
| 一般形式 | 设 \( B_1, B_2, \cdots, B_n \) 为样本空间的一个划分，则 \( P(B_j|A) = \dfrac{P(A|B_j)P(B_j)}{\sum_i P(A|B_i)P(B_i)} \)<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup> |
| 作用 | 颠倒作为条件的事件，把 \( P(A|B) \) 变成 \( P(B|A) \)<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup> |
| 起源 | 托马斯·贝叶斯（Thomas Bayes），《试解机遇学说中的一个问题》（An Essay Towards Solving a Problem in the Doctrine of Chances），《皇家学会哲学汇刊》，1763年，第370–418页<sup>[3](https://mlanthology.org/misc/1763/bayes1763misc-essay/)</sup> |
| 发表 | 由理查德·普莱斯（Richard Price）转交，1763年12月23日在皇家学会宣读，时距贝叶斯去世已两年<sup>[4](https://www.york.ac.uk/depts/maths/histstat/price.pdf)</sup> |
| 统计学角色 | 把先验分布与似然结合，形成用于推断的后验分布<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup> |
| 监管应用 | FDA指南草案（2026年1月），关于支持药物与生物制品试验主要推断的贝叶斯方法<sup>[5](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/use-bayesian-methodology-clinical-trials-drug-and-biological-products)</sup> |

## 公式

该定理直接来自条件概率的定义。对任意两个事件 \( A \) 与 \( B \)，其交集的概率可以写成两种形式：

\[ P(A|B)P(B) = P(A \cap B) = P(B|A)P(A). \]

除以必须非零的 \( P(A) \)，即得两事件形式：<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup>

\[ P(B|A) = \frac{P(A|B)P(B)}{P(A)}. \]

分母 \( P(A) \) 通常用全概率公式求得。若 \( B_1, B_2, \cdots, B_n \) 构成样本空间的一个划分，即它们互斥且穷尽所有可能，则对任意满足 \( P(A) \neq 0 \) 的事件 \( A \)：<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup>

\[ P(B_j|A) = \frac{P(A|B_j)P(B_j)}{\sum_{i} P(A|B_i)P(B_i)}. \]

在统计记号中，同一规则写在分布而非事件上。若 \( f(x|\theta) \) 是给定未知参数 \( \theta \) 时观测数据 \( x \) 的似然，\( g(\theta) \) 是 \( \theta \) 的先验分布，则后验分布为<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup>

\[ g(\theta|x) \propto f(x|\theta) \, g(\theta). \]

比例常数为数据边缘概率的倒数，其中数据的边缘概率由对分子在整个参数空间上积分得到。<sup>[17](https://www.princeton.edu/~umueller/HOE.pdf)</sup> 该定理颠倒了条件作用的方向：它用通常更容易提供的量——给定假设时数据的概率以及假设的先验可信度——来回答实践者通常关心的问题，即给定数据时假设的概率。<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup>

## 先验与后验

在贝叶斯统计中，未知量被建模为具有先验分布的随机变量，先验分布表达了在考察当前数据之前对各种取值可能性的初始评估。观测到数据 \( Y = y \) 后，贝叶斯公式给出后验分布，即给定观测时未知量 \( X \) 的条件分布。随后直接从后验分布计算点估计和区间估计（称为可信区间）；由于参数被当作随机变量处理，可信区间是关于它们的有效概率陈述。<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup><sup> • </sup><sup>[6](https://www.probabilitycourse.com/chapter9/9_1_0_bayesian_inference.php)</sup>

先验可以来自旧信息、主观判断或早期研究的数据。当先验与后验属于同一分布族时，它们被称为共轭分布，该先验即为共轭先验。贝塔分布是二项比例的共轭先验，伽马分布是指数分布总体的失效率的共轭先验，这一对在贝叶斯系统可靠性应用中广为使用。<sup>[2](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)</sup>

更新是累积的。今天的后验可以作为明天下一次推断的先验，因此贝叶斯观点把证据视为持续的数据流，每当有新数据可用时推断就得到更新。<sup>[7](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/guidance-use-bayesian-statistics-medical-device-clinical-trials)</sup>

## 诊断检验与基础率

一个标准应用是评估诊断检验。该定理把以疾病状态为条件的检验灵敏度和特异度，与以检验结果为条件、因而取决于该病常见程度的预测值联系起来。一种约每万人中有一人患的疾病，正是假阳性悖论的设定：由于该病罕见，即使高度准确的检验也可能给出大多为假的阳性结果。<sup>[1](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)</sup>

仅凭临床经验并不能准确应用贝叶斯规则，关于医生检验后概率估计的研究考察了患病率是否得到恰当加权。贝叶斯定理有助于克服诊断中众所周知的认知错误，例如忽视基础率、包括保守主义和锚定在内的概率调整错误，以及顺序效应。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC3055966/)</sup><sup> • </sup><sup>[9](https://ebm.bmj.com/content/ebmed/16/6/163.full.pdf)</sup>

## 贝叶斯推断与频率派推断

该定理也标志着一道哲学分界。无论在哲学还是实践中，统计学都由频率派与贝叶斯思想主导。<sup>[10](https://www.tandfonline.com/doi/full/10.1080/00031305.2018.1459317)</sup> 贝叶斯统计的独特之处在于，它不仅处理数据的概率分布，也处理统计假设的概率分布，把赋予假设的概率解读为信念程度——使认识论上的不确定性显式化。经典似然比检验对两个假设给出拒绝或接受的裁决，而贝叶斯比较则给出关于它们的后验概率。<sup>[11](https://plato.stanford.edu/archives/spr2026/entries/statistics/)</sup>

实际后果不同。频率派推断基于研究在多次假设重复下观测数据的期望频率，因此其设计需要固定样本量和预先指定的主要结局。贝叶斯分析则把先验分布与研究数据结合，形成用于推断的后验，从而使先验信息得以进入正式分析本身。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC12051211/)</sup> 在临床试验中，这支持在频率派误差控制下较难安排的适应性设计、中期分析和停止规则；FDA指出，纳入先验信息可以提高精度，并在某些情况下足以支持更小或更短的试验。<sup>[7](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/guidance-use-bayesian-statistics-medical-device-clinical-trials)</sup>

## 计算

应用该定理需要计算分母，即参数空间上的积分。即便简单的贝叶斯推断问题也可能迅速变得计算上不可行；在深度神经网络等复杂模型中，该积分是多维的，维数等于参数个数。<sup>[13](https://web.stanford.edu/class/msande226/lectures/lecture15_inference.pdf)</sup><sup> • </sup><sup>[14](https://link.springer.com/article/10.1007/s10462-023-10443-1)</sup>

基本的计算工具是马尔可夫链蒙特卡洛（MCMC）抽样，它从后验分布中模拟抽样；计算算法与计算速度的突破使非常复杂而现实的贝叶斯模型的计算成为可能，并推动了贝叶斯方法流行度的大幅上升。变分推断是另一种选择，它把积分问题转化为在一族近似分布上的优化问题。<sup>[7](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/guidance-use-bayesian-statistics-medical-device-clinical-trials)</sup><sup> • </sup><sup>[14](https://link.springer.com/article/10.1007/s10462-023-10443-1)</sup>

## 历史

该定理以牧师托马斯·贝叶斯命名，结果发表于《试解机遇学说中的一个问题》，载于《皇家学会哲学汇刊》第53卷（1763年），第370–418页。<sup>[3](https://mlanthology.org/misc/1763/bayes1763misc-essay/)</sup> 贝叶斯已于1761年去世，是他的朋友理查德·普莱斯将该文转交皇家学会；随附论文于1763年12月23日在那里宣读，包含十个命题和三条规则，并附有将它们应用于具体问题的附录。<sup>[4](https://www.york.ac.uk/depts/maths/histstat/price.pdf)</sup>

该文的接受过程缓慢。尽管具有创新性，它并未立即因其突破性而得到承认，而是被当时研究概率演算的人所忽视。<sup>[15](https://rss.onlinelibrary.wiley.com/doi/full/10.1111/1740-9713.01460)</sup> 后来的一个历史问题——1987年一项对该文及普莱斯增补部分的分析对此作了考察——是贝叶斯本人是否持有如今被称为贝叶斯主义的20世纪学说。<sup>[16](https://www.sciencedirect.com/science/article/pii/0315086087900656)</sup>

## References

1. [Bayes' Rule, ProbabilityCourse.com (Sawyer, Tucker et al.)](https://www.probabilitycourse.com/chapter1/1_4_3_bayes_rule.php)
2. [How can Bayesian methodology be used for reliability evaluation?, NIST Engineering Statistics Handbook](https://www.itl.nist.gov/div898/handbook/apr/section2/apr1a.htm)
3. [Thomas Bayes (1763). An Essay Towards Solving a Problem in the Doctrine of Chances, ML Anthology](https://mlanthology.org/misc/1763/bayes1763misc-essay/)
4. [Richard Price, Bayes' theorem, and God, University of York](https://www.york.ac.uk/depts/maths/histstat/price.pdf)
5. [Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products, Draft Guidance for Industry, FDA (January 2026)](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/use-bayesian-methodology-clinical-trials-drug-and-biological-products)
6. [Bayesian Inference, ProbabilityCourse.com](https://www.probabilitycourse.com/chapter9/9_1_0_bayesian_inference.php)
7. [Guidance for the Use of Bayesian Statistics in Medical Device Clinical Trials, FDA](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/guidance-use-bayesian-statistics-medical-device-clinical-trials)
8. [Does Prevalence Matter to Physicians in Estimating Post-test Probability of Disease? A Randomized Trial, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC3055966/)
9. [Bayes' theorem in diagnosis, BMJ Evidence-Based Medicine](https://ebm.bmj.com/content/ebmed/16/6/163.full.pdf)
10. [Michael Lavine (2019). Frequentist, Bayes, or Other? The American Statistician 73(sup1): 312–318](https://www.tandfonline.com/doi/full/10.1080/00031305.2018.1459317)
11. [Philosophy of Statistics, Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/archives/spr2026/entries/statistics/)
12. [Bayesian Statistics for Clinical Research, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC12051211/)
13. [MS&E 226: Fundamentals of Data Science, Lecture 15, Stanford](https://web.stanford.edu/class/msande226/lectures/lecture15_inference.pdf)
14. [Bayesian learning for neural networks: an algorithmic survey, Artificial Intelligence Review](https://link.springer.com/article/10.1007/s10462-023-10443-1)
15. [Bayes and Price: when did it start? Significance (2020)](https://rss.onlinelibrary.wiley.com/doi/full/10.1111/1740-9713.01460)
16. [Was Bayes a Bayesian? Historia Mathematica](https://www.sciencedirect.com/science/article/pii/0315086087900656)
17. [princeton.edu](https://www.princeton.edu/~umueller/HOE.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 20, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Conditional probability and independence › Bayes' rule and inversion

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/bayes-theorem

English original: https://www.edgepedia.org/bayes-theorem
