Calculating probability in a Bayesian Network

102 Views Asked by At

$$\require{enclose}\newcommand{\circletext}[1]{\enclose{circle}{\bbox[0.75ex]{\rm #1}}} \begin{array}{c} && \circletext{Influenza} &&&& \circletext{Smokes} \\ & \swarrow & \downarrow & \searrow & &\swarrow \\ \circletext{Sore\, throat} && \circletext{Fever} & & \circletext{Brochitis}\\ &&& \swarrow & & \searrow \\ && \circletext{Coughing}&&&&\circletext{Wheezing}\end{array}$$

Suppose I have a network defined as above. What would be the formula for calculating $\mathsf P(\text{Wheezing})$?

2

There are 2 best solutions below

2
On

Do you mean calculate it from the root probabilities and branch conditionals?

Letting $W$ stand for "Wheezing", $B$ for "Bronchitis", $I$ for "Influenza", $S$ for "Smoker", et cetera.

$$\def\P{\operatorname{\mathsf P}} \P(W) ~{=~ \sum\limits_{b\in\{B,B^\complement\}} \P(W\mid b)\P(b) \\ =~\sum\limits_{b\in\{B,B^\complement\}} \P(W\mid b)\Big(\sum\limits_{i\in\{I,I^\complement\}}\underline{\phantom{ \P(i)}}\big(\sum\limits_{s\in\{S,S^\complement\}}\underline{\phantom{\P(s)\P(b\mid s, i)}}\big)\Big) }$$

1
On

You have that:

$$P(I, SH, F, B, S, C, W) = P(I)P(SH|I)P(F|I)P(B|I,S)P(S)P(C|B)P(W|B)$$

Which will give you:

$$P(W) = \sum_{I,SH,F,B,S,C} P(I)P(SH|I)P(F|I)P(B|I,S)P(S)P(C|B)P(W|B)$$ $$P(W) = \sum_{I} P(I) \sum_{SH}P(SH|I) \sum_{F}P(F|I)\sum_{B} P(B|I,S) \sum_{S} P(S) \sum_{C} P(C|B)P(W|B)$$ $$P(W) = P(W|B) \sum_{C} P(C|B)$$ $$P(W) = P(W|B)$$