[20分] 數學勁人請答!!!(關於bayes theorem)

2007-09-28 9:42 am
我睇過wiki: http://en.wikipedia.org/wiki/Bayes'_theorem

條式係甘樣o既:

P(A|B)= P(B n A) * P(A) / P(B)

甘但係而家我有三個evidence: B1,B2,B3
佢地分別o既probability 都係已知
仲有P(A)都係已知
另外P(B1 | A),P(B2 | A),P(B3 | A) 分別o既conditional probability 都已知

即係話以下依d都係已知:
P(A)
P(B1)
P(B2)
P(B3)
P(B1 | A)
P(B2 | A)
P(B3 | A)

而家唔知o既就係P(A | B1 B2 B3)
所以我用Bayes theorem 甘樣計:

P(A | B1 B2 B3) = P(B1 | A) * P(B2 | A) * P(B3 | A) * P(A) / P(B)
更新1:

甘你會發現分子o個d 數全部都係已知...甘一定計得到喇 但係個分母P(B)點計呢??? 到底能唔能夠從我已知o既野入面計得出黎? 因為我認為P(B) 係P(B1),P(B2),P(B3) 一齊發生o既probability (亦即joint probability) 所以我認為個分母係P(B1) * P(B2) * P(B3), 就可以得出P(B),亦即係個分母 但係我亞sir話唔o岩woo, 請問有無人可以講比我聽點解, 同埋應該點計?

更新2:

但係bayes theorem 唔係假設左佢地係independent咩? 所以我先諗住將P(B1) * P(B2) * P(B3) 就可以計番P(B)出黎 係woo, o個度我打錯左

更新3:

哦...我知點解我會假設左佢地係independent喇 因為其實我係問緊naive bayes classifier, 依個同bayes theorem o既分別就係在於佢會假設左佢地係independent http://en.wikipedia.org/wiki/Naive_bayes_classifier

更新4:

因為係要用naive bayes classifier 去計, 所以其實已經當左佢地係independent 所以我先甘唔明個分母點解唔可以直接用P(B1) * P(B2) * P(B3) 去計

更新5:

甘簡單黎講 如果要計番 P(B) 而家我知道P(B1) P(B2) P(B3)都唔係independent 甘有無方法計到呀?

更新6:

好在你講比我知原來naive bayes classifier 無assume埋P(B1) P(B2) P(B3)都係independent

回答 (2)

2007-09-28 10:46 am
✔ 最佳答案
First of all P(B) = P(B1)*P(B2)*P(B3) if events B1, B2 and B3 are "independent", this is important because it won't work this way otherwise.

Secondly, Bayes theorem should be stated P(A|B) = P(B| A) * P(A) / P(B) not P(B n A) * P(A) / P(B) so be careful.

Are any of these events independent? you may need to know this before getting any further.

2007-09-28 03:01:04 補充:
No, Bayes theorem does not assume the events are independent. Dose the question say the events B1, B2 and B3 independent then??

2007-09-29 01:36:10 補充:
Naive bayes classifier, the "naive" conditional independence assumptions assumes that each feature Fi is "conditionally independent" of every other feature Fi for i not equal to j, meaning P(Fi|C,Fj) = P(Fi|C)So it does not assume B1, B2 and B3 are independent
2007-09-28 11:05 am
其實最大既問題係你假設左D事件係Independent.
兩件事independent 即係:
P(A&B) = P(A) * P(B)

由於無人話過佢地係Independent,
所以 P(B|A) 未必等於P(B1|A) * ...*P(B3|A), 而 P(B)亦未必等於P(B1)*..P(B3)

即係除非你知道B1, B2, B3之間有幾多係重覆(即係知道 B1 & B2 & B3之類既Prob), 否則你計唔到的

不妨用個Venn Diagram, 考慮兩個既case (即得B1&B2), 你會發現A, B1, B2, A&B1, A&B2既面積即使不變, A&B1&B2同B1&B2既面積比, 係可以變的.
參考: me


收錄日期: 2021-04-23 00:19:15
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070928000051KK00255

檢視 Wayback Machine 備份