Göm menyn

729G78 Artificiell intelligens

Laboration 5: Probabilistisk logik

Purpose

The purpose of this lab is to provide you with some experience and understanding of modelling and interpreting Bayesian Networks. You will acquire hands-on experience with a tool for constructing probabilistic models.

Preparation

In preparation for this lab you should:

  • Read chapter 13.1-5 and 14.1-4 in the course book before doing this lab. You should have an understanding of what Bayesian Networks are, how they are constructed, and their theoretical underpinnings..
  • Download, open and rename the exercises document Lab5Exercises_LiU-ID-1_LiU-ID-2.odt to match your group's LiU-IDs.
  • The software that you will use during the lab is called "Bayes Applet". Look at tutorials at http://aispace.org/bayes/. Download bayes.jar from the course library. To start the program, double-click the jar-file or run it from a terminal using: java -jar bayes.jar.
    You are encouraged to try to model the earthquake example on page 512 in the course book as a warmup. It is strongly recommended that you have a look at the first and the third tutorials listed, since this will make the rest of the lab go much quicker. The topics in tutorials 4-6 are not covered in this lab, but read them if you are interested in the topic.

Note: The networks you save from and load into the program are in .xml format. If you have trouble saving an xml-file from the applet you can click on the "Edit/ViewEdit Text representation (.xml format)" in the program and copy-paste the contents to a new local file.

Part 1: Inference in an existing Bayesian network

In this part of the lab, you will be provided with an existing Bayesian Network. The purpose is to provide you with a chance to query the network and investigate probabilisitic inference on such networks. You will then use the network to answer a few questions, which will aid you in understanding the basics of probabilistic inference in Bayesian networks.

Scenario

The local nuclear power plant has been running for a long time and now the owner (mr M.B.) wants to know whether there has been any degradation in the safety of the plant. He hires a group of safety experts who will use Bayesian Networks as a modeling tool for prediction and explanation. After gathering empirical data the plant's consultants created the network in Figure 1. The underlying data is available in this file.

nuclear_plant_network image
Figure 1: The Bayesian Network for the nuclear plant.

The owner asks you to start experimenting with the network and find out how safe the plant is.
  • Save a copy of the file. Start the applet and choose "File/Load Problem" and select the file you saved.
  • You should now see that a network has been created in the applet window.
  • Important: Set the Network Options / Decimal Places for Monitoring to 5. This means that you will be able to accurately see changes in probabilities.

Exercises

Use the applet and the loaded Bayesian Network to complete the exercises below.
  1. Complete Exercises 1 to 7.
  2. New temperature statistics from SMHI are in! It turns out that the temperature is actually within normal range 90% of the time, while extreme temperatures (low and high) only make up 5% each. Update the network to reflect this new knowledge.
  3. Complete Exercise 8.

Part 2: Extending a network

Scenario

Mr. M.B. is quite selfish and wants to optimize profit of the plant at the expense of safety, yet he is very worried about his own survival. Instead of increasing the safety of the plant, which is costly, he decides to analyse his chances of escaping from the plant in case of a meltdown. Mr M.B. asks you to investigate the properties of his escape vehicle (his car). After significant research and a series of experiments you come up with the following conditional and prior probabilities:
  • P(battery | temperature=cold) = 0.80
  • P(battery | temperature=normal) = 0.98
  • P(radio | battery) = 0.95
  • P(ignition | battery) = 0.81
  • P(gas) = 0.69
  • P(starts | gas ∧ ignition) = 0.91
  • P(moves | starts) = 0.99
  • P(survives | moves ∧ meltdown) = 0.86
  • P(survives | moves ∧ ¬meltdown) = P(survives | ¬moves ∧ ¬meltdown) = 1.0
  • P(survives | ¬moves ∧ meltdown) = 0.0

Exercises

  1. Model the car and integrate it with the model of the plant by looking at the probabilities above. Use the existing node Temperature as your starting point. Fill in any remaining probabilities by using common-sense reasoning about the domain (i.e. leaving them as the default 0.5 is not acceptable). Save the new network as lab5-part2-LiU-ID-1_LiU-ID-2.xml.
  2. Complete Exercises 9 and 10.

Part 3: More extensions

Scenario

After your excellent analysis of the plant and of the owner's car, he realizes that his life is in grave danger if the plant has a meltdown. He realizes that he needs to hire someone to be in charge of the plant's safety. After several interviews he decides that a Mr H.S. is the most suitable person for the job (because he practically works for free). Mr M.B. again ask you to modify the model (i.e. extend from part 2) to include his new employee who has some less appealing properties:
  • He sleeps a lot during work, which means that he can not react that rapidly to warning signals and so on.
  • He is very incompetent. Even if he is awake he doesn't always know what to do when an alarm goes off.
  • He has a less than healthy appreciation for a beverage named "Duff", which lowers his competence even further and increases the risk of him falling asleep.

Exercises

  1. Create a model of the properties of the new employee. The requirements of the model are the following:
    • The extension should include at least four random discrete variables (i.e. nodes).
    • All probabilities should be set and match the informal description of Mr H.S.'s properties.
    • Think carefully about the direction of your causal relationships!
    • The new network should be saved as a new file lab5-part3-LiU-ID-1_LiU-ID-2.xml. (Do not replace the old file!)
  2. Complete Exercise 11.
  3. For VG only: Complete Exercises 12 and 13.

Hand-in

The examination for this lab will consist of the following:
  1. In the exercises where the applet is used for obtaining the result, you must clearly state what variables you choose to observe and why. Also include the steps of any calculations.
  2. Save the exercises document as PDF.
  3. Before handing in:
    1. Show an assistant your calculations for exercises 7 and 8.
    2. Briefly describe your extension of the network in part 3 and show that no fields in the probability tables have been left at their default values.
    3. (VG only) Describe the disjunction in part 3.
  4. Upload your completed files (the networks and the exercises document) to Lisam.

Sidansvarig: Robin Keskisärkkä