Created
August 22, 2018 17:03
-
-
Save asdfgeoff/f70409b3245e25e342173f468207894c to your computer and use it in GitHub Desktop.
A python version of the earthquake example given in ISYE 6420 Unit 3.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network unknown { | |
} | |
variable Burglary { | |
type discrete [ 2 ] { True, False }; | |
} | |
variable Earthquake { | |
type discrete [ 2 ] { True, False }; | |
} | |
variable Alarm { | |
type discrete [ 2 ] { True, False }; | |
} | |
variable JohnCalls { | |
type discrete [ 2 ] { True, False }; | |
} | |
variable MaryCalls { | |
type discrete [ 2 ] { True, False }; | |
} | |
probability ( Burglary ) { | |
table 0.999, 0.001; | |
} | |
probability ( Earthquake ) { | |
table 0.998, 0.002; | |
} | |
probability ( Alarm | Burglary, Earthquake ) { | |
(False, False) 0.999, 0.001; | |
(False, True) 0.71, 0.29; | |
(True, False) 0.06, 0.94; | |
(True, True) 0.05, 0.95; | |
} | |
probability ( JohnCalls | Alarm ) { | |
(False) 0.95, 0.05; | |
(True) 0.1, 0.9; | |
} | |
probability ( MaryCalls | Alarm ) { | |
(False) 0.99, 0.01; | |
(True) 0.3, 0.7; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment