probability calculation for bayesian network

11.1k Views Asked by At

I am studying Bayesian belief networks and in that I am struggling to understand how probabilities are calculated. I found this article here

and the network is this:
enter image description here

The associated probabilities are:
enter image description here

I don't understand how the probability
P(Tampering=true|Report=T) is calculated.

How I did it was

P(Alarm=T|Tampering=T,Fire=T)*P(Leaving=T|Alarm=T)*P(Report=T|Leaving=T)*P(Tampering=T)+
P(Alarm=T|Tampering=T,Fire=F)*P(Leaving=T|Alarm=T)*P(Report=T|Leaving=T)*P(Tampering=T)+
P(Alarm=F|Tampering=T,Fire=T)*P(Leaving=T|Alarm=F)*P(Report=T|Leaving=T)*P(Tampering=T)+ P(Alarm=F|Tampering=T,Fire=F)*P(Leaving=T|Alarm=F)*P(Report=T|Leaving=T)*P(Tampering=T)+
P(Alarm=T|Tampering=T,Fire=T)*P(Leaving=F|Alarm=T)*P(Report=T|Leaving=F)*P(Tampering=T)+
P(Alarm=T|Tampering=T,Fire=F)*P(Leaving=F|Alarm=T)*P(Report=T|Leaving=F)*P(Tampering=T)+
P(Alarm=F|Tampering=T,Fire=T)*P(Leaving=F|Alarm=F)*P(Report=T|Leaving=F)*P(Tampering=T)+
P(Alarm=F|Tampering=T,Fire=F)*P(Leaving=F|Alarm=F)*P(Report=T|Leaving=F)*P(Tampering=T)
which gives me a value= 0.017989

But the given answer for P(tampering=T|report=T) = 0.399

How do I calculate this probability

1

There are 1 best solutions below

2
On BEST ANSWER

I think the calculation should be:

\begin{align} P(T\mid R) &= \dfrac{P(R,T)}{P(R)} = \dfrac{P(R,T)}{P(R,T)+P(R,\neg T)} \\ & \\ P(R,T) &= \sum_{L,A,F\in\{True,False\}} P(R,T,A,F) \\ &= \sum_{L,A,F\in\{True,False\}} P(R\mid L)\;P(L\mid A)\;P(L\mid T,F)\;P(T)\;P(F) \\ & \\ &= (0.75)(0.88)(0.5)(0.02)(0.01) & \qquad [L,A,F] \\ &= + (0.75)(0.88)(0.85)(0.02)(0.99) & \qquad [L,A,\neg F] \\ &= + (0.75)(0.001)(0.5)(0.02)(0.01) & \qquad [L,\neg A,F] \\ &= + (0.75)(0.001)(0.15)(0.02)(0.99) & \qquad [L,\neg A,\neg F] \\ &= + (0.01)(0.12)(0.5)(0.02)(0.01) & \qquad [\neg L,A,F] \\ &= + (0.01)(0.12)(0.85)(0.02)(0.99) & \qquad [\neg L,A,\neg F] \\ &= + (0.01)(0.999)(0.5)(0.02)(0.01) & \qquad [\neg L,\neg A,F] \\ &= + (0.01)(0.999)(0.15)(0.02)(0.99) & \qquad [\neg L,\neg A,\neg F] \\ & \\ &= 0.011227. \\ & \\ P(R,\neg T) &= \sum_{L,A,F\in\{True,False\}} P(R,\neg T,A,F) \\ &= \sum_{L,A,F\in\{True,False\}} P(R\mid L)\;P(L\mid A)\;P(L\mid \neg T,F)\;P(\neg T)\;P(F) \\ & \\ &= (0.75)(0.88)(0.99)(0.98)(0.01) & \qquad [L,A,F] \\ &= + (0.75)(0.88)(0.0001)(0.98)(0.99) & \qquad [L,A,\neg F] \\ &= + (0.75)(0.001)(0.01)(0.98)(0.01) & \qquad [L,\neg A,F] \\ &= + (0.75)(0.001)(0.9999)(0.98)(0.99) & \qquad [L,\neg A,\neg F] \\ &= + (0.01)(0.12)(0.99)(0.98)(0.01) & \qquad [\neg L,A,F] \\ &= + (0.01)(0.12)(0.0001)(0.98)(0.99) & \qquad [\neg L,A,\neg F] \\ &= + (0.01)(0.999)(0.01)(0.98)(0.01) & \qquad [\neg L,\neg A,F] \\ &= + (0.01)(0.999)(0.9999)(0.98)(0.99) & \qquad [\neg L,\neg A,\neg F] \\ & \\ &= 0.01690. \\ & \\ \therefore\quad P(T\mid R) &= \dfrac{0.011227}{0.011227+0.01690} = 0.399 \end{align}

$\\$

Just for clarity, for example, the fourth term in the first numeric calculation: $$(0.75)(0.001)(0.15)(0.02)(0.99) \qquad [L,\neg A,\neg F]$$ equates to $$P(R\mid L)\;P(L\mid\neg A)\;P(\neg A\mid T,\neg F)\;P(T)\;P(\neg F).$$