# Summation of conditional probability in Bayesian network

I have the joint distribution of the bayesian network defined as

$P(CERFD)=P(C)\times P(R)\times P(E|CR) \times P(F|E) \times P(D|F)$

and I am trying to calculate $P(D=d|C=c)$, below are my workings and I am stuck at the last step:

$P(D=d|C=c)= \frac{P(D=d,C=c)}{P(C=c)}$ $=\frac{\sum_{ERF}P(C=c)\times P(R)\times P(E|C=c,R) \times P(F|E) \times P(D=d|F)} {\sum_{DERF}P(C=c)\times P(R)\times P(E|C=c,R) \times P(F|E) \times P(D|F)}$

$=\frac{\sum_{ERF}P(C=c)\times P(R)\times P(E|C=c,R) \times P(F|E) \times P(D=d|F)} {\sum_{DERF}P(C=c)\times P(R)\times P(E|C=c,R) \times \sum_F P(F|E) \times \sum_D P(D|F)}$

$=\frac{\sum_{ERF}P(C=c)\times P(R)\times P(E|C=c,R) \times P(F|E) \times P(D=d|F)} {\sum_{ER}P(C=c)\times \sum_R P(R)\times \sum_E P(E|C=c,R) \times 1}$

$=\frac{\sum_{ERF}P(C=c)\times P(R)\times P(E|C=c,R) \times P(F|E) \times P(D=d|F)} {P(C=c)\times 1}$

I don't even know how to simplify the numerator at all... This is not homework, I am learning probabilistic graphical model from coursera and I'm testing my own understanding.

-
Don't bother with your initial factorization into P(D=d,C=c)/P(C=c); you can leave the conditional statement in throughout the math. For the numerator, note that P(D=d|F) X P(F|E) = P(D=d|E). It's helpful also if you write out the full conditional statements, e.g., P(D=d|E,F) X P(F|E) = P(D=d|E) throughout; I think that lacking those full conditionals may be where your confusion comes from. – jbowman Mar 30 '12 at 14:24
$\Pr(C=c)$ is a constant for given $c$ so you can cancel that from the numerator and denominator. – Henry Mar 30 '12 at 14:37
Thank you for answering. Do you mind directing me to the proof of P(D=d|F) X P(F|E) = P(D=d|E) and P(D=d|E,F) X P(F|E) = P(D=d|E)? My understanding of conditional probabilities is too weak. – King Mar 30 '12 at 21:53

From your given conditional probabilities, we can marginalize the intermediate terms in the following manner:

$p(e | c) = \sum_r p (e | c, r) p (r)$

$p(f | c) = \sum_e p(f | e) p(e | c)$

$p(d | c) = \sum_f p(d | f) p(f | c)$

Putting everything together, we end up with the following:

$P(d | c) = p(d|f) p(f | e) p (e | c, r) p (r) = \sum_f p(d|f) \sum_e p(f | e) \sum_r p (e | c, r) p (r)$

-