This document provides an overview of using the GeNIe software for constructing and simulating Bayesian and decision networks. It discusses downloading and installing GeNIe, describes the basic interface components like nodes and arcs, and provides examples for building a simple Bayesian network model about sprinklers and grass, and a decision network model about choosing to pay for a boat. The document also discusses using GeNIe to calculate expected utilities and determine the optimal decision.
1. MSIM 410/510 Model Engineering
GeNIe for Bayesian Networks
Gornto 221
2:45-4:00pm
2. GeNIe | Introduction
GeNIe – Graphical Network Interface –
can be used to construct and simulate
Bayesian and Decision networks
• Graphically represent probability results
• Predict probability of an outcome and
results of related variables
GeNIe Interface
3. GeNIe | Download
Installation Files – On Blackboard
Under Modules --> Modules 6: Statistical Based Modeling --> GeNIe 2. . 1 Download
5. GeNIe | Bayesian Network Example
Sprinkler Raining
Wet
Grass
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
P(S=T) P(S=F)
0.2 0.8
P(R=T) P(R=F)
0.4 0.6
S R P(W=T|S, R) P(W=F|S, R)
T T 0.95 0.05
T F 0.90 0.10
F T 0.90 0.10
F F 0.10 0.90
6. GeNIe | Bayesian Network Example
Sprinkler Raining
Wet
Grass
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler On 0.2
Sprinkler Off 0.8
Raining 0.4
Not Raining 0.6
Sprinkler Sprinkler On Sprinkler Off
Raining Raining Not Raining Raining Not Raining
Wet Grass 0.95 0.9 0.9 0.1
Dry Grass 0.05 0.1 0.1 0.9
7. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Use the “Chance” Tool to create three “Chances”
Sprinkler
Wet
Grass
8. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
Use the “Arc” Tool to connect
9. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
Double click on the “Sprinkler Chance”, go to the “Definition”
tab and change the two states as the ones shown in the figure
above.
10. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
Double click on the “Raining Chance”, go to the “Definition”
tab and change the two states as the ones shown in the figure
above.
11. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
Double click on the “Wet Grass Chance”, go to the
“Definition” tab and change the two states as the ones shown
in the figure above.
12. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
The probability that the grass is wet?
13. GeNIe | Bayesian Network Example
1. Run the simulation
2. Check the results by
double clicking the
“Wet Grass” chance
then go to the “Value”
tab
14. GeNIe | Bayesian Network Example
Raining
P(S) = 0.2 P(R) = 0.4
P(W|R, S) = 0.95
P(W|R, ~S) = 0.90
P(W|~R, S) = 0.90
P(W|~R, ~S) = 0.10
Sprinkler
Wet
Grass
Given that the sprinkler is on, what is the
probability that the grass is wet?
15. GeNIe | Bayesian Network Example
Since we know that the sprinkler is on, we need to set “Sprinkler On” as
the evidence.
• Right click on the little check mark of the “Sprinkler” chance, “Set
Evidence” - > “SprinklerON”
16. GeNIe | Bayesian Network Example
1. Run the simulation again
2. Check the results by
double clicking the
“Wet Grass” chance
then go to the “Value”
tab
18. GeNIe | Decision Network Example
An Expected Utility “score” is to be determined for each possible decision outcome, and the Highest
Expected Utility points to the “best” decision that can be made.
Calculating Highest Expected Utility:
First calculate Expected Utility (EU) for: if John decides to pay for the boat
P(FC=Y) * U(FC|JP=Y) + P(FC=N) * U(FC=Y|JP=Y)
= (0.4 * 0.55 + 0.6 * 0.25) * 100 + (0.4 * 0.45 + 0.6 * 0.75) * -50
= 5.5
Next calculate EU for: if John decides to Not pay for the boat
P(FC=Y) * U(FC|JP=N) + P(FC=N) * U(FC=N|JP=N)
= (0.4 * 0.55 + 0.6 * 0.25) * 25 + (0.4 * 0.45 + 0.6 * 0.75) * -25
= -6.5
The Highest Expected Utility is derived from the case where John decides to pay for the Boat, so that will be his decision.
24. GeNIe | Decision Network Example
if John decides to pay for the boat
25. GeNIe | Decision Network Example
if John decides to not pay for the boat
26. GeNIe | Decision Network Example
Burglary (B) and earthquake (E) directly affect the
probability of the alarm (A) going off, but whether or not
John calls (J) or Mary calls (M) depends only on the alarm.
Your tasks:
1. Construct this network using GeNIe.
2. Investigate these two questions by running the
simulation in GeNIe
a. What is the probability that there is a
burglary given that John calls?
b. What about if Mary also calls right after
John hangs up?
3. Record the results from GeNIe by using screenshot and paste them to a word doc. Turn in both your model file
and doc file on Blackboard by the end of class. Please do not submit .zip or .rar files.