A Bayesian
network (BN) is used to model a domain containing uncertainty in
some manner. In the past, the term causal probabilistic networks
have been used. A BN is a directed acyclic graph (DAG) where each
node represents a random variable. Each node contains the states of
the random variable it represents and a conditional probability
table (CPT) or in more general terms a conditional probability
function (CPF). The CPT of a node contains probabilities of the
node being in a specific state given the states of its parents. The
following example demonstrates what all this means.
The Apple Tree Example
In this example, the domain is a small apple
plantation belonging to Jack Fletcher (let's call him Apple
Jack). One day Apple Jack discovers that his finest apple tree is
losing its leaves. Now, he wants to know why this is happening. He
knows that if the tree is dry (caused by a drought) there is no
mystery - it is very common for trees to lose their leaves during a
drought. On the other hand the loosing of leaves can be an
indication of disease.
The situation can be modeled by the BN in
figure 1. The BN consists of three nodes: Sick, Dry, and Loses
which can all be in one of two states: Sick can be either
"sick" or "not" - Dry can be either
"dry" or "not" - and Loses can be either
"yes" or "no". The node Sick tells us that the
apple tree is sick by being in state "sick". Otherwise,
it will be in state "not". The nodes Dry and Loses tell
us in the same way if the tree is dry and if the tree is losing its
leaves, respectively.
|
| Figure
1: BN representing the domain of the Apple Jack
problem. |
The BN in figure
1 models that there is a causal dependency from Sick to Loses and
from Dry to Loses. This is represented by the two arrows.
When there is a causal dependency from one node
A to another node B, we expect that when A is in a certain state
this has impact on the state of B. One should be careful when
modeling the causal dependencies in a BN. Sometimes it is not quite
obvious which direction an arrow should have. E.g. in our example
we say that there is a causal arrow from Sick to Loses because when
a tree is sick this might cause the tree to lose its leaves. But
could we not say that when the tree loses its leaves, it might be
sick and turn the arrow in the other direction? No, we cannot! It
is the sickness that causes the lost leaves and not the lost leaves
that cause the sickness.
In figure 1, we have the graphical
representation of the BN. However, this is only what we call the
qualitative representation of the BN. Before we can call it a BN,
we need to specify the quantitative representation.
The quantitative representation of a BN is the
set of CPTs of the nodes. Table 1, 2, and 3 show the CPT of the
three nodes in the BN of figure 1.
|
Sick="sick" |
Sick="not" |
| 0.1 |
0.9 |
|
| Table 1:
P(Sick). |
|
Dry="dry" |
Dry="not" |
| 0.1 |
0.9 |
|
| Table 2:
P(Dry). |
|
|
Dry="dry" |
Dry="not" |
|
Sick="sick" |
Sick="not" |
Sick="sick" |
Sick="not" |
|
Loses="yes" |
0.95 |
0.85 |
0.90 |
0.02 |
|
Loses="no" |
0.05 |
0.15 |
0.10 |
0.98 |
|
| Table 3: P(Loses
| Sick, Dry). |
Note that all
three tables show the probability of a node being in a specific
state depending on the states of its parent nodes but since Sick
and Dry do not have any parent nodes, tables 1 and 2 are not
conditioned by anything.
What we have shown in this example is a
description of how a very simple BN is constructed. The Hugin
development environment provides you with tools to construct such
networks. When you have constructed a network, you can use it for
entering evidence in some of the nodes where the state is known and
then retrieve the new probabilities calculated in other nodes
corresponding to this evidence. In the apple tree example, suppose
you know that the tree is losing its leaves. You enter this
evidence by selecting the state "yes" in the Loses node.
Then you can read the probability of the tree being sick as the
probability of the node Sick being in state "sick" and
the probability of the tree being dry as the probability of the
node Dry being in state "dry".
If you are in the process of learning more
about the Hugin development environment, now would be a good time
to go through the first tutorial in the introduction to the Hugin
GUI. Here, the apple tree BN is constructed using the Hugin GUI.
You can also go on reading the introduction to
influence diagrams which are
BNs extended with utility nodes and decision nodes.