贝叶斯定理
维基百科,自由的百科全书
贝叶斯定理(Bayes theorem),是概率论中的一个结果,它跟随机变量的条件概率以及边缘概率分布有关。在有些关于概率的解说中,贝叶斯定理(贝叶斯更新)能够告知我们如何利用新证据修改已有的看法。
通常,事件A在事件B(发生)的条件下的概率,与事件B在事件A的条件下的概率是不一样的;然而,这两者是有确定的关系,贝叶斯定理就是这种关系的陈述。
作为一个规范的原理,贝叶斯定理对于所有概率的解释是有效的;然而,频率主义者和贝叶斯主义者对于在应用中概率如何被赋值有着不同的看法: 频率主义者根据随机事件发生的频率,或者总体样本里面的个数来赋值概率;贝叶斯主义者要根据未知的命题来赋值概率。一个结果就是,贝叶斯主义者有更多的机会使用贝叶斯定理。本文深度讨论了这些争论。
目录 |
[编辑] 贝叶斯定理的陈述
贝叶斯定理是关于随机事件A和B的条件概率和边缘概率的一則定理。
其中L(A|B)是在B发生的情况下A发生的可能性。
在贝叶斯定理中,每个名词都有约定俗成的名称:
- Pr(A)是A的先驗概率或邊緣概率。之所以稱為"先驗"是因為它不考慮任何B方面的因素。
- Pr(A|B)是已知B發生后A的條件概率,也由于得自B的取值而被稱作A的后驗概率。
- Pr(B|A)是已知A發生后B的條件概率,也由于得自A的取值而被稱作B的后驗概率。
- Pr(B)是B的先驗概率或邊緣概率,也作標准化常量(normalized constant).
按這些術語,Bayes定理可表述為:
- 后驗概率 = (相似度 * 先驗概率)/標准化常量
也就是說,后驗概率与先驗概率和相似度的乘積成正比。
另外,比例Pr(B|A)/Pr(B)也有時被稱作標准相似度(standardised likelihood),Bayes定理可表述為:
- 后驗概率 = 標准相似度 * 先驗概率
[编辑] 從條件概率推導貝氏定理
根據條件概率的定義 . 在事件B发生的条件下事件 A发生的概率是
同樣地, 在事件A发生的条件下事件 B发生的概率
整理与合并這兩個方程式, 我們可以找到
这个引理有时称作概率乘法规则.上式兩邊同除以Pr(B), 若Pr(B)是非零的, 我們可以得到贝叶斯 定理:
[编辑] 二中擇一的形式
貝氏定理通常可以再寫成下面的形式:
其中AC是A的補集(即非A)。故上式亦可寫成:
在更一般化的情況,假設{Ai}是事件集合裡的部份集合,對於任意的Ai,貝氏定理可用下式表示:
[编辑] 以可能性與相似率表示貝氏定理
- 参见:全機率定理
其中
定義為B發生時,A發生的可能性(odds);
則是A發生的可能性。相似率(Likelihood ratio)則定義為:
[编辑] 貝氏定理與機率密度
貝氏定理亦可用於連續機率分佈。由於機率密度函數嚴格上並非機率,由機率密度函數導出貝氏定理觀念上較為困難(詳細推導參閱[1])。貝氏定理與機率密度的關係是由求極限的方式建立:
全機率定理則有類似的論述:
如同離散的情況,公式中的每項均有名稱。 f(x, y)是X和Y的聯合分佈; f(x|y) 是給定Y=y後,X的後驗分佈; f(y|x) = L(x|y)是Y=y後,X的相似度函數(為x的函數); f(x) 和f(y)則是X和Y的邊際分佈; f(x)則是X的先驗分佈。 為了方便起見,這裡的f在這些專有名詞中代表不同的函數(可以由引數的不同判斷之)。
[编辑] 貝氏定理的推廣
對於變數有二個以上的情況,貝式定理亦成立。例如:
這個式子可以由套用多次二個變數的貝式定理及條件機率的定義導出:
一般化的方法則是利用聯合機率去分解待求的條件機率,並對不加以探討的變數積分(意即對欲探討的變數計算邊緣機率)。取決於不同的分解形式,可以證明某些積分必為1,因此分解形式可被簡化。利用這個性質,貝氏定理的計算量可能可以大幅下降。貝氏網路為此方法的一個例子,貝氏網路指定數個變數的聯合機率分佈的分解型式,該機率分佈滿足下述條件:當其他變數的條件機率給定時,該變數的條件機率為一簡單型式。
[编辑] 範例
[编辑] 例一:醫學檢驗中的錯誤陽性反應
[编辑] 例二:條件機率
[编辑] 参见
[编辑] References
[编辑] Versions of the essay
- Thomas Bayes (1763), "An Essay towards solving a Problem in the Doctrine of Chances. By the late Rev. Mr. Bayes, F. R. S. communicated by Mr. Price, in a letter to John Canton, A. M. F. R. S.", Philosophical Transactions, Giving Some Account of the Present Undertakings, Studies and Labours of the Ingenious in Many Considerable Parts of the World 53:370–418.
- Thomas Bayes (1763/1958) "Studies in the History of Probability and Statistics: IX. Thomas Bayes's Essay Towards Solving a Problem in the Doctrine of Chances", Biometrika 45:296–315. (Bayes's essay in modernized notation)
- Thomas Bayes "An essay towards solving a Problem in the Doctrine of Chances". (Bayes's essay in the original notation)
[编辑] Commentaries
- G. A. Barnard (1958) "Studies in the History of Probability and Statistics: IX. Thomas Bayes's Essay Towards Solving a Problem in the Doctrine of Chances", Biometrika 45:293–295. (biographical remarks)
- Daniel Covarrubias. "An Essay Towards Solving a Problem in the Doctrine of Chances". (an outline and exposition of Bayes's essay)
- Stephen M. Stigler (1982). "Thomas Bayes's Bayesian Inference," Journal of the Royal Statistical Society, Series A, 145:250–258. (Stigler argues for a revised interpretation of the essay; recommended)
- Isaac Todhunter (1865). A History of the Mathematical Theory of Probability from the time of Pascal to that of Laplace, Macmillan. Reprinted 1949, 1956 by Chelsea and 2001 by Thoemmes.
[编辑] Additional material
- Pierre-Simon Laplace (1774). "Mémoire sur la Probabilité des Causes par les Événements", Savants Étranges 6:621–656; also Œuvres 8:27–65.
- Pierre-Simon Laplace (1774/1986). "Memoir on the Probability of the Causes of Events", Statistical Science 1(3):364–378.
- Stephen M. Stigler (1986). "Laplace's 1774 memoir on inverse probability", Statistical Science 1(3):359–378.
- Stephen M. Stigler (1983). "Who Discovered Bayes's Theorem?" The American Statistician 37(4):290–296.
- Jeff Miller et al. Earliest Known Uses of Some of the Words of Mathematics (B). (very informative; recommended)
- Athanasios Papoulis (1984). Probability, Random Variables, and Stochastic Processes, second edition. New York: McGraw-Hill.
- James Joyce (2003). "Bayes's Theorem", Stanford Encyclopedia of Philosophy.
- The on-line textbook: Information Theory, Inference, and Learning Algorithms, by David J.C. MacKay provides an up to date overview of the use of Bayes's theorem in information theory and machine learning.
- Stanford Encyclopedia of Philosophy: Bayes's Theorem provides a comprehensive introduction to Bayes's theorem.
- 埃立克·魏爾斯史甸在MathWorld中所描述之Bayes' Theorem。
- Bayes' theorem at PlanetMath.


















