Bayesian Networks and Decision Graphs

Contents

Introduction

In order to learn a bit about Bayesian networks, I am working my way through Bayesian Networks and Decision Graphs by Finn Jensen (Springer, 2001, website), refered to henceforth as BNADG. Jensen recommends using software to work through the examples. Although he makes some suggestions in the Preface, I have chosen to use JavaBayes and OpenBayes - primarily OpenBayes.

Notes and Exercises

Stud Farm

Jensen (2001:46-50). Unless otherwise stated figures and tables are quoted from this section of Jensen.

The scenario here is a horse family tree, as shown in Figure 1. "John suffers from a life-threatening hereditary disease carried by a recessive gene. ... What are the probabilities for the remaining horses to be carriers of the unwanted gene?"

Figure 1: The stud farm network.
fig1.gif

Tables 1-3 show P(Child | Father, Mother) for the various horse groups (i.e., we know John is sick, we know the rest of the horses are not sick). Figure 2 shows the model with initial probabilities. Figure 3 shows the model with probabilities given that John is sick.

The python script studfarm.py (in bnadg_scripts.tar.gz) implements the stud farm model in Python, using the OpenBayes package. The probabilities in Figures 2 & 3 above are output from studfarm.py, and they are not exactly the same as those given in the book, though they are within a few percentage points of those in the book (they are also identical with the results obtained from JavaBayes). The equivalent of Figure 3 in BNADG is Figure 2.15 where, for example, Ann has (Carrier: 0.6356, Pure: 0.3644) and Dorothy as (Carrier: 0.8114, Pure: 0.1886).

Of course, the probabilities all change when we receive evidence about a vertex the network, but it's interesting that the probabilities are affected purely by relating the vertices to each other (i.e., in Figure 2).

Table 1: P(Child | Father, Mother) for genetic inheritance.

The numbers (a, b, c) are the child's probabilities for (aa=sick, aA=carrier, AA=pure).

aa aA AA
aa (1, 0, 0) (0.5, 0.5, 0) (0, 1, 0)
aA (0.5, 0.5, 0) (0.25, 0.5, 0.25) (0, 0.5, 0.5)
AA (0, 1, 0) (0, 0.5, 0.5) (0, 0, 1)
Table 2: P(Child | Father, Mother) when the parents are not sick.
aA AA
aA (0.25, 0.5, 0.25) (0, 0.5, 0.5)
AA (0, 0.5, 0.5) (0, 0, 1)
Table 3: P(Child | Father, Mother) when nobody is sick.
aA AA
aA (0.67, 0.33) (0.5, 0.5)
AA (0.5, 0.5) (0, 1)
Figure 2: The stud farm with initial probabilities.
fig2.gif
Figure 3: The stud farm probabilities given that John is sick.
fig3.gif