January 2002
Version I
**** IN PREPARATION, APPLETS DO NOT WORK! ****
Contents:
A bayesian network is a causal network comprising:
The variable and edges form a Directed Acyclic Graph (DAG), i.e. there are no "feed-back cycles" in the graph. The root nodes of this graph have unconditional probabilities associated with them.
Equation 1
P(ai and bi) = P(ai) x P(bi) |
where ai and bi are possible values for two variables A and B, and P(n) is the probability of value n being true (probability is expressed as a real number between 0.0 and 1.0.
Alternatively we can calculate the joint probability using:
Equation 2
p(ai and bi) = p(ai | bi) x p(bi) |
Where p(ai | bi) is the conditional probability of the value ai existing if the value bi exists.
Equation 3
p(bi | ai) x p(ai) p(ai | bi) = -------------------- p(bi) |
In Figure 1 a network with a diverging connection is presented such that A causes both B and C.
Figure 1: Diverging connection
We will assume that each variable has two values i and j each with which has a probability associated with it. The variables might then be interpreted as follows:
Variable | Interpretation |
---|---|
ai | Rail travel disruption |
aj | No rail travel disruption |
bi | Trevor late at work |
bj | Trevor not late at work |
bi | Paul late at work |
bi | Paul not late at work |
We then attach probability tables to each node. In the case of A, the root node, this will be an unconditional probability table (P(A) = 1):
Variable | P |
---|---|
ai | 0.7 |
aj | 0.3 |
Thus the probability of there being disruption on the railways is 0.7. We attach conditional probability tables to nodes B and C (P(B|A) and P(C|A)). That for B is given below (C will have identical values).
ai | aj | |
---|---|---|
bi | 0.8 | 0.1 |
bj | 0.2 | 0.9 |
Note that the figures entered into these tables, for example that the probability of Trevor being late for work if there is disruption on the rail ways is 0.8 or that the probability that Trevor will be late for work if there is no disruption on the railways is 0.1 is subjective.
The joint probability table for p(A and B) is given below (again that for p(A and C) will have identical values). The values are calculated using Equation 2, fir example:
p(bn and an) = p(bn | an) x p(an)
Thus:
p(bi and ai) = p(bi | ai x p(ai) = 0.8 x 0.7 = 0.56
ai | aj | |
---|---|---|
bi | 0.8 x 0.7 = 0.56 | 0.1 x 0.3 = 0.03 |
bj | 0.2 x 0.7 = 0.14 | 0.9 x 0.3 = 0.22 |
By marginalising A from p(B and A) we get p(B):
p(B) = p(C) = ((0.56+0.03),(0.14,0.27)) = (0.59,0.41)
i.e.
p(B=bi) = p(C=ci) = 0.59 p(B=bj) = p(C=cj) = 0.41
Thus:
Variable | P |
---|---|
ai | 0.70 |
aj | 0.30 |
bi | 0.59 |
bj | 0.41 |
ci | 0.59 |
cj | 0.41 |
i.e. the probability of Trevor or Paul being late for work is 0.59.
Now supposing that we obtain evidence that bi is true, i.e. B = bi (Trevor is late for work); we say that node B has become instantiated. Knowledge of this now allows us to revise the probability table for node A. The revision is done by calculating the conditional probability of A given B = bi (p(A|B=bi)), using:
p(B=bi|A) p(A) p(A|B=bi) = --------------------- p(B=bi)
We know that:
p(B=bi) = 0.59 | (The probability of Trevor being late at work for what ever reason) |
p(bi|ai) = 0.8 | (The probability of Trevor being late at work due to disruption on the railways) |
p(bi|aj) = 0.1 | (The probability of Trevor being late at work for some other reason) |
p(ai) = 0.7 | (The probability of disruption on the railways) |
p(ai) = 0.3 | (The probability of no disruption on the railways) |
Thus:
(0.8,0.1) x (0.7,0.3) (0.8 x 0.7,0.1 x 0.3) p(A|B=bi) = ----------------------- = ----------------------- 0.59 0.59 (0.56,0.03) = ------------- = (0.95,0.05) 0.59
The new probability table for Node A is now:
Variable | P |
---|---|
ai | 0.95 |
aj | 0.05 |
Note that the probability of there being disruption on the railways has increased as a result of node B being instantiated (i.e. knowledge that Trevor is late at work).
The new probability table for Node C must now be calculated using:
P(ci and ai) = ci x ai
ai | aj | |
---|---|---|
bi | 0.8 x 0.95 = 0.760 | 0.1 x 0.05 = 0.005 |
bj | 0.2 x 0.95 = 0.190 | 0.9 x 0.05 = 0.045 |
and
P(C) = (0.765,0.235)
Thus:
Variable | P |
---|---|
ai | 0.950 |
aj | 0.050 |
bi | 1.000 |
bj | 0.000 |
ci | 0.765 |
cj | 0.235 |
The probability of Paul being late at work has increased to 0.765 from 0.59.
If we now receive knowledge that there is no disruption on the railway (A = aj and P(aj)=1) this will have no effect on node B (we know that Trevor is late), however we must revise our probability table for C
ai | aj | |
---|---|---|
bi | 0.8 x 0.0 = 0.0 | 0.1 x 1.0 = 0.1 |
bj | 0.2 x 0.0 = 0.0 | 0.9 x 1.0 = 0.9 |
Thus:
Variable | P |
---|---|
ai | 0.000 |
aj | 1.000 |
bi | 1.000 |
bj | 0.000 |
ci | 0.100 |
cj | 0.900 |
Created and maintained by Frans Coenen. Last updated 01 February 2002