# Bayes Network computing conditional probabilities

There is a bayesian network Asia:

I am computing based on

A (visit to Asia)
S (smoker)
T (tuberculosis)
L (lung cancer)
B (bronchitis)
E (tuberculosis versus lung cancer/bronchitis)
D (dyspnoea)
X (chest X-ray)

P(A)=0.01
P(S)=0.50
P(T)=0.0104
P(L)=0.055
P(B)=0.45
P(E)=0.064828
P(D)=0.4393105
P(X)=0.11029004


How would you compute probabilities when you assign truth values to ceratin observable variables like?

p(X=yes|A=no,  S=yes)
p(D=yes|L=no,  B=yes)
p(E=yes|L=yes, T=no)
p(D=yes|B=yes, T=yes)

-
I think your notation may be a bit off, or your probabilities are inconsistent. For instance, there is only one link for Asia (A), and that leads to tuberculosis (T). So this means that $P(A)\geq P(T)$. But you have assigned $P(A)=0.01<0.0104 = P(T)$. So this is inconsistent. I think this is actually $P(T|A)=0.0104$. But then the rest is unclear, are these conditional probabilities? Is $P(D)$ conditional on $B$ or $E$? or just $B$? or just $E$? – probabilityislogic Mar 25 '11 at 12:31
yes $P(D)$ conditional on $B$ and $E$, as T is conditional on $A$, L and B are conditional on $S$, i did not write it correctly. – cMinor Mar 27 '11 at 0:09

For your four example questions, it looks rather easy, if I am reading this correctly.

The first asks for the probability the individual has tuberculosis or cancer given not having tuberculosis and not having cancer. That should be 0.

The second, third and fourth ask for the probability the individual has tuberculosis or cancer given some combination of having them. That should be 1 each time.

I suspect that these are not quite what you are trying to ask. For example the proportion of individuals who have both tuberculosis and cancer might be $0.0104 + 0.055 - 0.064828 = 0.000572$. This is also suggested if the lack of an arrow between tuberculosis and cancer means they are independent and $0.0104 \times 0.055 = 0.000572$.

But there is no such clarity for example with the relationship between a visit to Asia and tuberculosis. This is not independent as there is an arrow, but more individuals have tuberculosis than visited Asia. Are we supposed to assume that everyone who visited Asia now has tuberculosis? It does not say that.

-
In fact I would like to know a general way to compute any query, is this possible knowing the probabilities?, so for example how to compute queries like P(D=true|A=true,S=true), P(D=true|X=true,S=true), ETC... – cMinor Mar 25 '11 at 0:01
If you could work out the joint probabilities then you could work out the conditional probabilities. So for P(D=true|A=true,S=true), it would help to know P(D=true,A=true,S=true) and P(D=false,A=true,S=true) – Henry Mar 25 '11 at 6:21
But the Bayes formula says something like the sum / something, is it enough to know those probabilities? Could you please post an example? – cMinor Mar 25 '11 at 6:37
P(D=true|A=true,S=true) = P(D=true,A=true,S=true) / (P(D=true,A=true,S=true) + P(D=false,A=true,S=true)) = P(A=true,S=true|D=true) * P(D=true) / ((P(A=true,S=true|D=true) * P(D=true) + P(A=true,S=true|D=false) * P(D=false)) – Henry Mar 25 '11 at 6:45
and for example when you do: (P(A=true,S=true|D=true) and P(A=true,S=true|D=false) these expressions can be replaced even more with simpler expressions? – cMinor Mar 25 '11 at 6:50
show 1 more comment

You have to compute joint probabilities first, and then the marginal probabilities you are interested in, thanks to sum-product.

-

@darkcminor: I wonder if the following short tutorial would help you (look especially at the chain rule and the section on inference). I have not looked at these for a long time, but I believe with a few principles you can figure out the values of any query. Some of them will just be onerous done by hand.

http://www.cs.ubc.ca/~murphyk/Bayes/bnintro.html

-