solve $P(C = 0, F = 1)$ bayes network

74 Views Asked by At

given this:

enter image description here

And I want to solve $P(C = 0, W = 1)$. Which I did below: $$P(C = 0, W = 1) = P(C = 0)P(W = 1 | C = 0)$$

$$= P(C = 0) \big[P(W = 1 | R = 0, S = 0) \cdot P(R = 0 | C = 0) \cdot P(S = 0 | C = 0) + P(W = 1 | R = 0, S = 1) \cdot P(R = 0 | C = 0) \cdot P(S = 1 | C = 0) + P(W = 1 | R = 1, S = 0) \cdot P(R = 1 | C = 0) \cdot P(S = 0 | C = 0) + P(W = 1 | R = 1, S = 1) \cdot P(R = 1 | C = 0) \cdot P(S = 1 | C = 0)\big]$$

$$= (1 -P(C = 1) \big[P(W = 1 | R = 0, S = 0) \cdot (1 - P(R = 1 | C = 0)) \cdot (1 - P(S = 1 | C = 0)) + P(W = 1 | R = 0, S = 1) \cdot (1 - P(R = 1 | C = 0)) \cdot P(S = 1 | C = 0) + P(W = 1 | R = 1, S = 0) \cdot P(R = 1 | C = 0) \cdot (1 - P(S = 1 | C = 0)) + P(W = 1 | R = 1, S = 1) \cdot P(R = 1 | C = 0) \cdot P(S = 1 | C = 0)\big]$$

now plugging in

$$(1-0.5)(0.01 \cdot (1-0.2) \cdot (1 - 0.5) + 0.9 \cdot (1 - 0.2) \cdot 0.5 + 0.9 \cdot 0.2 \cdot (1 - 0.5) + 0.99 \cdot 0.2 \cdot 0.5) = 0.2765$$

It's correct I'm pretty sure.

I tried to change this up a bit by adding. Now I want to solve $P(C = 0, F = 1)$

enter image description here

attempt:

$$P(C = 0, F = 1) = P(C = 0)P(F = 1 | C = 0) = P(C = 0)(P(F = 1 | W = 0) \cdot P(W = 0 | R = 0, S = 0) \cdot P(R = 0 | C = 0) \cdot P(S = 0 | C = 0) + \cdots)$$

I'm confused on the total probability portion im not sure how to derive this. I also know this is probably going to be really long but im just looking for the first few parts of $P(F = 1 | C = 0)$ to get me started

1

There are 1 best solutions below

0
On BEST ANSWER

1) From the DAG we see that (in shorthand): $\def\P{\operatorname{\sf P}}\P_{C,W}=\sum\limits_{S,R}\P_C\P_{S\mid C}\P_{R\mid C}\P_{W\mid S,R}$

So to check your work: $$\begin{align} \P_{C,W}(0,1)&=\P_C(0)\sum_{s}\P_{S\mid C}(s\mid 0)\sum_r\P_{R\mid C}(r\mid 0)\P_{W\mid S,R}(1\mid s,r) \\[1ex]&=0.5(0.5(0.2(0.9+0.99)+0.8(0.01+0.9))) \\[1ex]&=0.2765 \end{align}$$

2) Similarly, $\P_{C,F}~{= \sum_{W}\P_{C,W}\P_{F\mid W}\\=\sum_\limits{S,R,W}\P_C\P_{S\mid C}\P_{R\mid C}\P_{W\mid S,R}\P_{F\mid W} }$

So to get you 'started' we note you have done about half of the work already.

$$\begin{align}\P_{C,F}(0,1)&=\P_{C,W}(0,1)\P_{F\mid W}(1\mid 1)+\P_{C,W}(0,0)\P_{F\mid W}(1\mid 0)\\[1ex]&=0.02765+\P_C(0)\sum_s\P_{S\mid C}(s\mid 0)\sum_r\P_{R\mid C}(r\mid 0)\P_{W\mid S,R}(0\mid s,r)\P_{F\mid W}(1\mid 0)\\[0ex]&~~\vdots\end{align}$$