{"id":1046,"date":"2014-02-25T09:12:17","date_gmt":"2014-02-25T01:12:17","guid":{"rendered":"http:\/\/systemsci.org\/jinshanw\/?p=1046"},"modified":"2014-02-25T09:12:17","modified_gmt":"2014-02-25T01:12:17","slug":"learned-something-new-about-bayesian-formula-last-night-and-by-the-hard-way","status":"publish","type":"post","link":"https:\/\/www.systemsci.org\/jinshanw\/2014\/02\/25\/learned-something-new-about-bayesian-formula-last-night-and-by-the-hard-way\/","title":{"rendered":"Learned something new about Bayesian formula last night and learned the hard way"},"content":{"rendered":"<p>Bayesian formula,<br \/>\n&#091;P(A|B)=\\frac{P(B|A)P(A)}{P(B|A)P(A)+P(B|\\bar{A})P(\\bar{A})}&#093;<br \/>\nis conceptually straightforward, but amazingly useful in statistics. It turns calculation of &#040;P(A|B)&#041; into finding out &#040;P(B|A)&#041; by simply making use of the rule of total probability,<br \/>\n&#091;P(A\\cap B) = P(A|B)P(B) = P(B|A)P(A)&#093;<br \/>\nand<br \/>\n&#091;P(A) = P(A\\cap B) + P(A\\cap \\bar{B}). &#093;<\/p>\n<p>This seems rather trivial to me. Here comes the surprising part. Let us now add another set &#040;C&#041; in the following way,<br \/>\n&#091;P\\left(A|B\\right) = P\\left(\\left(A|C\\right)|B\\right)P\\left(C|B\\right) + P\\left(\\left(A|\\bar{C}\\right)|B\\right)P\\left(\\bar{C}|B\\right),  \\hspace{2cm}     (1)&#093;<br \/>\nor in this way,<br \/>\n&#091;P\\left(A|B\\right) = P\\left(\\left(A|B\\right)|C\\right)P\\left(C\\right) + P\\left(\\left(A|B\\right)|\\bar{C}\\right)P\\left(\\bar{C}\\right).    \\hspace{2cm}    (2)&#093;<\/p>\n<p>Now let us ask which one of the above two formulae is the proper one, or both, or none?<\/p>\n<p>It is easy to verify the first one: Assuming<br \/>\n&#091;P\\left(\\left(A|C\\right)|B\\right) = P\\left(A|\\left(C,B\\right)\\right) = \\frac{A\\cap B \\cap C}{B \\cap C}, \\hspace{2cm}    (3)&#093;<br \/>\nthen right-hand side of Equ(1) becomes<br \/>\n&#091;\\frac{A\\cap B \\cap C}{B \\cap C}\\frac{B\\cap C}{B} + \\frac{A\\cap B \\cap \\bar{C}}{B \\cap \\bar{C}}\\frac{B\\cap \\bar{C}}{B} = \\frac{A\\cap B \\cap C}{B} + \\frac{A\\cap B \\cap \\bar{C}}{B} = \\frac{A\\cap B}{B}, \\hspace{1cm}    (4)&#093;<br \/>\nwhich is exactly the left-hand side of Equ(1).<\/p>\n<p>Verifying Equ(2) is however not easy. If the assumption in Equ(3) is right, then Equ(2) becomes<br \/>\n&#091;\\frac{A\\cap B \\cap C}{B \\cap C}\\frac{C}{\\Omega} + \\frac{A\\cap B \\cap \\bar{C}}{B \\cap \\bar{C}}\\frac{\\bar{C}}{\\Omega}. \\hspace{1cm}   (4)&#093;<br \/>\nI can see no clue that this expression should be &#040;\\frac{A\\cap B}{B}&#041;.<\/p>\n<p>However, if &#040;P\\left(A|B\\right)&#041; is the probability of a set of events, then the second one should be correct too. So what is the problem? It seems to me that when discussing &#040;P\\left(A|B\\right)&#041;, we have implicitly limited the whole set, which originally is &#040;\\Omega&#041;, to be &#040;B&#041;, therefore, all the expressions derived from there should have carried the condition &#040;B&#041; forever. So lesson one: Keeping the condition &#040;B&#041; as the condition for all other events. Therefore, Equ(1), not Equ(2), should be used in our case.<\/p>\n<p>Another lesson learned is that conditional probability is a tricky concept and one has to deal it with extra attention.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bayesian formula, &#091;P(A|B)=\\frac{P(B|A)P(A)}{P(B|A) &hellip; <a href=\"https:\/\/www.systemsci.org\/jinshanw\/2014\/02\/25\/learned-something-new-about-bayesian-formula-last-night-and-by-the-hard-way\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cLearned something new about Bayesian formula last night and learned the hard way\u201d<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[15],"_links":{"self":[{"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/posts\/1046"}],"collection":[{"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/comments?post=1046"}],"version-history":[{"count":0,"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/posts\/1046\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/media?parent=1046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/categories?post=1046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemsci.org\/jinshanw\/wp-json\/wp\/v2\/tags?post=1046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}