# How to calculate joint probabilities from conditional probabilities in a Bayesian Network?

This question is about Bayesian Networks. I want to calculate the probability for certain events to be in a certain state knowing all conditional probabilities.

Consider that I am totally new to Bayesian Networks.

# The problem

Consider a Bayesian Network. For all variables $A_i,B_i \dots Z_i$ in the network I know the potentials in the form $P\{ A_i | par(A_i) \}=P\{A_i | B_1 \dots B_n\}$ for all possible states $a_i,b_1 \dots b_n$. These potentials are calculated using subjective probabilities.

# Calculating single probabilities

What I know are just potentials. For example, for variable $A_i$ I do not know $P\{A_i = a_i\}$ but I know $P\{A_i = a_i | B_1=b_1 \dots B_n=b_n\}$. Where $B_1, B_2 \dots B_n$ are parents of $A_i$.

I want to calculate $P\{A_i = a_i\}$. Consider that No restrictions are considered so this variable $A_i$ can have parents and children. As well as $B_1 \dots B_n$.

It does not seem to complicated. Having potentials I can use the total probability law and:

$$P\{ A_i = a_i \} = \sum_{\forall b_1 \dots b_n} P\{ A_i = a_i | B_1=b_1 \dots B_n=b_n \} \cdot P\{B_1=b_1 \dots B_n=b_n \}$$

In the sum, the first part: $P\{ A_i = a_i | B_1=b_1 \dots B_n=b_n \}$ can be calculated using potentials.

What about $P\{B_1=b_1 \dots B_n=b_n \}$. That is, How can I calculate the probability that some variables have some state contemporarly? Please note that $B_1 \dots B_n$ are not one parent of the other, they are on the same level of the network, they are peers, meaning they have no parent relationship. They are parents of $A_i$.

# The question

Generally speaking, how to calculate the probability that some variables are in some state contemporarly? When they have no parent relationships? Preconditions are: I know the conditional probabilites (potentials).

-

Do $A_i$ have no children? Do $B$ have no parents?

In general, you can't know $P(B_i)$ without also evaluating $P(A_i)$ because diagnostic evidence from below $A$ can affect $A$, which affects $B$.

I think the efficient solution is to calculate lambda and pi messages, which are the predictive and diagnostic evidence from the parent and child nodes of $A$.

For details, see lecture 10 and 11 from here. If I have time, I'll come back and summarize the notes.

-
Sorry I am new to this things... I updated a little my question. Why can't I use the total prob law to get the single probability? What do you mean by lambda? –  Andry Apr 17 '12 at 1:12
If you think there is a better approach rather than the total prob law, please tell me about lambda and messages. It will be very appreciated. Thanks for your efforts. –  Andry Apr 17 '12 at 1:13
@Andry: see my edit. –  Neil G Apr 17 '12 at 1:19
I am checking, thanks a lot. –  Andry Apr 17 '12 at 1:26