comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/burglar-alarm-net.lisp.txt @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 #|
2 The following code represents the burglar alarm Bayes network from
3 Chapter 14 of Russell & Norvig, 2nd Edition. This network representation
4 is used in the corresponding Bayes net code found in this directory.
5
6 The conditional probability tables consist of the values listed here
7 (along with the probabilities of the corresponding complementary events):
8
9 P(Burglary = true) = 0.001 (=> P(Burglary = false) = 0.999)
10 P(Earthquake = true) = 0.002 (=> P(Earthquake = false) = 0.998)
11
12 P(Alarm = true | Burglary = true, Earthquake = true) = 0.95
13 P(Alarm = true | Burglary = true, Earthquake = false) = 0.94
14 P(Alarm = true | Burglary = false, Earthquake = true) = 0.29
15 P(Alarm = true | Burglary = false, Earthquake = false) = 0.001
16
17 P(JohnCalls = true | Alarm = true) = 0.90
18 P(JohnCalls = true | Alarm = false) = 0.05
19
20 P(MaryCalls = true | Alarm = true) = 0.70
21 P(MaryCalls = true | Alarm = false) = 0.01
22 |#
23
24 (setf *burglar-alarm-net*
25 '((MaryCalls (true false)
26 (Alarm)
27 ((true) 0.70 0.30)
28 ((false) 0.01 0.99))
29 (JohnCalls (true false)
30 (Alarm)
31 ((true) 0.90 0.10)
32 ((false) 0.05 0.95))
33 (Alarm (true false)
34 (Burglary Earthquake)
35 ((true true) 0.95 0.05)
36 ((true false) 0.94 0.06)
37 ((false true) 0.29 0.71)
38 ((false false) 0.001 0.999))
39 (Burglary (true false)
40 ()
41 (0.001 0.999))
42 (Earthquake (true false)
43 ()
44 (0.002 0.998))
45 ))