How to compute this conditional probability in Bayesian Networks?

1.1k Views Asked by At

I met a problem related to conditional probability from the article "Bayesian Networks without Tears"(download) on page 3.

According to the Figure 2, the author says $$P(fo=yes|lo=true, hb=false)=0.5$$

While I don't know how to calculate it and obtain the correct result. I attached the screenshot of Figure 2. from the article. I tried it as following $$P(fo|lo, \bar{hb})=\frac{P(lo, \bar{hb}|fo)\cdot P(fo)}{P(lo, \bar{hb})}=\frac{P(lo|fo)\cdot P(\bar{hb}|fo)\cdot P(fo)}{P(lo, \bar{hb})}$$

And $P(lo|fo)=0.6,\ P(fo)=0.15$, but how to know other 3 terms?

Thank you!

enter image description here

1

There are 1 best solutions below

6
On

Other than the normal rules on conditional probability, the key thing specific to working with Bayesian networks (BN) is the rules regarding independence and conditional independence of the events represented by the nodes.

Without using the independence inferred by the particular network you can only get so far. There are lots of notes around if you google "Bayesian network". One example: Bayesian Networks.

I'll use a common method of solving it. Let's name the five events as:

\begin{eqnarray*} F &=& \mbox{family out} \\ B &=& \mbox{bowel problem} \\ D &=& \mbox{dog out} \\ H &=& \mbox{hear bark} \\ L &=& \mbox{light on} \end{eqnarray*}

(Note that there seems to be a typo in the diagram. It has $P(D \mid \lnot F, B) = 0.3$. This I think should be $P(D \mid \lnot F, \lnot B) = 0.3$.)

Every possible situation that can occur in our scenario can be represented by the intersection of these five events, each one either occurring or not occurring. E.g. all five events occurring is $(F,B,D,H,L)$. There are $2^5 = 32$ such combinations, and if we needed to, we could calculate all $32$ with the information provided. An example of how this is done follows. The Chain Rule of probability gives:

\begin{eqnarray*} P(F,B,D,H,L) &=& P(L \mid F,B,D,H) \times P(H \mid F,B,D) \times P(D \mid F,B) \times P(B \mid F) \times P(F) \\ &=& P(L \mid F) \times P(H \mid D) \times P(D \mid F,B) \times P(B) \times P(F) \\ &=& 0.6 \times 0.7 \times 0.99 \times 0.01 \times 0.15 \\ &=& 0.0006237 \end{eqnarray*}

The second step there is really the key part and it uses the BN rules for independence, which are explained in the above link (too much to explain here).

To the calculation of $P(F \mid L, \lnot H)$, which is what we want,

$$P(F \mid L, \lnot H) = \dfrac{P(L, F, \lnot H)}{P(L, \lnot H)}$$

We work out the numerator and denominator separately:

$$P(L, F, \lnot H) = P(L, F, \lnot H, \lnot B,\lnot D) + P(L, F, \lnot H, \lnot B,D) + P(L, F, \lnot H, B,\lnot D) + P(L, F, \lnot H, B,D)$$

This is just applying $4$ combinations of the two missing events, $B$ and $D$.

Each of these $4$ terms can be calculated as above for $P(F,B,D,H,L)$. E.g.

\begin{eqnarray*} P(L, F, \lnot H, \lnot B,\lnot D) &=& P(L \mid F,\lnot B,\lnot D,\lnot H) \times P(\lnot H \mid F,\lnot B,\lnot D) \times P(\lnot D \mid F,\lnot B) \times P(\lnot B \mid F) \times P(F) \\ &=& P(L \mid F) \times P(\lnot H \mid \lnot D) \times P(\lnot D \mid F,\lnot B) \times P(\lnot B) \times P(F) \\ &=& 0.6 \times 0.99 \times 0.1 \times 0.99 \times 0.15 \\ &=& 0.0088209 \end{eqnarray*}

Similarly we can get:

$$P(L, F, \lnot H, \lnot B,D) = 0.6 \times 0.3 \times 0.9 \times 0.99 \times 0.15 = 0.024057$$

$$P(L, F, \lnot H, B,\lnot D) = 0.6 \times 0.99 \times 0.01 \times 0.01 \times 0.15 = 0.00000891$$

$$P(L, F, \lnot H, B,D) = 0.6 \times 0.3 \times 0.99 \times 0.01 \times 0.15 = 0.0002673$$

So the numerator:

$$P(L, F, \lnot H) = 0.0088209 + 0.024057 + 0.00000891 + 0.0002673 = 0.03315411$$

By a similar method we can calculate the denominator, summing over $8$ terms, $4$ of which are those in the numerator. So now we do the other $4$:

\begin{eqnarray*} P(L, \lnot F, \lnot H,B,D) &=& P(L \mid \lnot F) \times P(\lnot H \mid D) \times P(D \mid \lnot F,B) \times P(B) \times P(\lnot F) \\ &=& 0.05 \times 0.3 \times 0.97 \times 0.01 \times 0.85 \\ &=& 0.000123675 \end{eqnarray*}

\begin{eqnarray*} P(L, \lnot F, \lnot H,B, \lnot D) &=& P(L \mid \lnot F) \times P(\lnot H \mid \lnot D) \times P(\lnot D \mid \lnot F,B) \times P(B) \times P(\lnot F) \\ &=& 0.05 \times 0.99 \times 0.03 \times 0.01 \times 0.85 \\ &=& 0.0000126225 \end{eqnarray*}

\begin{eqnarray*} P(L, \lnot F, \lnot H,\lnot B,D) &=& P(L \mid \lnot F) \times P(\lnot H \mid D) \times P(D \mid \lnot F,\lnot B) \times P(\lnot B) \times P(\lnot F) \\ &=& 0.05 \times 0.3 \times 0.3 \times 0.99 \times 0.85 \\ &=& 0.00378675 \end{eqnarray*}

\begin{eqnarray*} P(L, \lnot F, \lnot H,\lnot B,\lnot D) &=& P(L \mid \lnot F) \times P(\lnot H \mid \lnot D) \times P(\lnot D \mid \lnot F,\lnot B) \times P(\lnot B) \times P(\lnot F) \\ &=& 0.05 \times 0.99 \times 0.7 \times 0.99 \times 0.85 \\ &=& 0.029157975 \end{eqnarray*}

Summing these $4$ terms and the numerator, we get:

$$P(L, \lnot H) = 0.000123675 + 0.0000126225 + 0.00378675 + 0.029157975 + 0.03315411 = 0.0662351325$$

Finally, our answer:

$$P(F \vert L, \lnot H) = \dfrac{0.03315411}{0.0662351325} = 0.5005517275895839719200380$$