14.2 Stochastic Inference 337
Figure 14.2 Example of diagnostic inference using a BN. The evidence for diagnosis
is the perception of a fever by the patient. The question to be answered is whether
the patient has influenza.
ability, so it is essentially the same as the probabilistic notion of anevent.
Let A and B be the two events in this case. The BN is specified by giv-
ingPr(A),Pr(B|A)andPr(B| notA). Suppose that one is given the
evidence that B is true. What is the probability that A is true? In other
words, what isPr(A|B)? The JPD of this BN is given by the four prod-
uctsPr(B|A)Pr(A),Pr(notB|A)Pr(A),Pr(B|notA)Pr(notA),and
Pr(notB|notA)Pr(notA). Selecting just the ones for which B is true, gives
the two probabilitiesPr(B|A)Pr(A)andPr(B|notA)Pr(notA).Thesum
of these two probabilities is easily seen to bePr(B). Dividing byPr(B)nor-
malizes the distribution. In particular,Pr(A|B)=Pr(B|A)Pr(A)/P r(B),
which is exactly the classic Bayes’ law.
Returning to the problem of determining the probability of influenza, the
evidence requires that we select only the terms of the JPD for which PF is
true, then compute the marginal distribution. Integrating over the tempera-
tures in the first column of table 14.1 gives the following: We are only inter-
ested in the Flu node, so we sum the rows above in pairs to get: Normalizing
givesPr(Flu)=0. 009. Thus there is less than a 1% chance of having the
flu even if one is complaining of a fever. Perceiving a fever has the effect of
increasing the probability of having the flu substantially over the case of no
evidence, but it is still relatively low.
The most general form of BN inference is to give evidence in the form
of a PD on the evidence nodes. The only difference in the computation is