# Math Help - Bayesian network and distributions

1. ## Bayesian network and distributions

Hi,

I'm new when it comes to Bayesion networks and would be glad if someone could give me some hints on a problem.

I have the following probability distributions:

P(A)
P(B)
P(X|C)
P(Y|C)
P(C|A,B)

I would like to find P(A|X=true, Y= false). The domain of all variables are: true, false.

I have no idea how to start on this? Any tips?

2. ## Re: Bayesian network and distributions

Hey PeterPan2009.

Just to get things starting, can you show us what you've tried?

3. ## Re: Bayesian network and distributions

Originally Posted by chiro
Hey PeterPan2009.
Just to get things starting, can you show us what you've tried?
Hi chiro!

Well, to be honest, I'm not sure how to start. That is, I'm not sure about the strategy to use to simplify the problem - in terms of the probabilities and distributions I know. The first step may be to use Bayes' rule like this (I'm not sure this is valid though):

$P(A|X=true, Y=false) = \frac{P(X=true,Y=false|A)\times P(A)}{P(X=true, Y=false)}$

And then marginalise over some variable?

4. ## Re: Bayesian network and distributions

This is what I have so far (I don't know if this is correct):

$P(A|X=true, Y=false)$

Using Bayes' rule:
$= \frac{P(X=true, Y=false|A) P(A)}{P(X=true, Y=false)}$

$= \alpha P(X=true, Y=false|A) P(A)$

Using marginalisation on C:
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false, C=c|A) \bigg] P(A)$

$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false |C=c, A) P(C=c|A) \bigg] P(A)$

Using P(X,Y|C,A)P(C|A)=P(X,Y|C)P(C|A):
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false, C=c) P(C=c|A) \bigg] P(A)$

Using marginalisation on B:
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false, C=c) \bigg[ \sum_{b \in Domain(B)} P(C=c, B=b|A)\bigg] \bigg] P(A)$

$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false, C=c) \bigg[ \sum_{b \in Domain(B)} P(C=c|B=b, A) P(B=b|A))\bigg] \bigg] P(A)$

Now I don't know what to do?

5. ## Re: Bayesian network and distributions

Can you sum any of the variables out (since summing out all probabilities of a particular random variable sums out the variable entirely)?

6. ## Re: Bayesian network and distributions

Updated:

$P(A|X=true, Y=false)$

Using Bayes' rule:
$= \frac{P(X=true, Y=false|A) P(A)}{P(X=true, Y=false)}$

$= \alpha P(X=true, Y=false|A) P(A)$

Using marginalisation on C:
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false, C=c|A) \bigg] P(A)$

$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false |C=c, A) P(C=c|A) \bigg] P(A)$

Using P(X,Y|C,A)P(C|A)=P(X,Y|C)P(C|A):
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false | C=c) P(C=c|A) \bigg] P(A)$

Using marginalisation on B:
$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false | C=c) \bigg[ \sum_{b \in Domain(B)} P(C=c, B=b|A)\bigg] \bigg] P(A)$

$= \alpha \bigg[ \sum_{c \in Domain(C)} P(X=true, Y=false | C=c) \bigg[ \sum_{b \in Domain(B)} P(C=c|B=b, A) P(B=b|A))\bigg] \bigg] P(A)$

Hm, how do I sum out any variables. I have the distribution for P(C=c|B=b, A), but I dont have e.g. P(X=true, Y=false|C=c) only P(X=true|C=c) and P(y=false|C=c)?

7. ## Re: Bayesian network and distributions

I think I figured this out. The important thing is to be aware of is that nodes in a network can be conditionally independent.