Bayesian Belief and Decision Networks

applet home
help contents
quickstart
general help
tutorials
 

 

Contents

Overview

Menu Help

Create Mode

Solve Mode

Node Legend

The Verbose Query Window

The Inspecting Factors Window

The Independence Quiz Window

The XMLBIF Format


Overview

The Bayesian Belief and Decision Networks applet is a tool to visually solve Bayesian Nets. It has a robust variable elimination algorithm, and allows users to create their own networks and customize the domains and probabilities. The applet has features that allow the user to inspect probabilities, make observations, and monitor nodes. It also allows the user to manually do variable elimination and to inspect the factors created.

The applet also has features to add no-forgetting arcs. There is an independence quiz mode that tests the user on his or her knowledge of the independence rules of Bayesian Nets.

Menu Help

The File Menu

The File Menu has options to create graphs and load files, as well as quitting the program. The application version of the applet can also save files.

The Edit Menu

The Edit Menu allows the user to view a text representation of the Bayesian network.

The Graph Options

The Graph Options menu allows the user to change the appearance of the applet display.

The Query Control Options

The Query Control Options menu allows the user to change how queries and monitoring are done by the applet. Also, it has options to hide or show independence quiz and decision network options.

Create Mode

Create Mode allows the user to define a Bayesian Network manually (belief and decision nets, depending on whether the Decision Net Controls are on). Keep in mind that node names should be unique.

Solve Mode

Solve Mode allows the user to query nodes' probabilities, either by automatically doing the variable elimination, or by letting the user manually do the elimination. It provides functions to observe nodes, and monitor the probabilities. Solve mode also allows the user to optimize decision networks.

Node Legend

The Verbose Query Window

The Verbose Query Window allows the user to manually execute variable elimination. Its format is similar to the main window, with a large canvas area to the right and a left control panel.

The canvas area displays the current Bayes network. The color and shape cues for the network are the same as the main applet window, with some differences. A green coloured node indicates that that node is the node being queried. In optimizing decision nodes, the value node is green. Highlighted nodes (nodes with thicker borders) are nodes that can be eliminated at that state in the variable elimination.

The left side panel contains two lists of factors. The 'Current Factors' list indicates the factors that represent the current graph. The 'Eliminated Factors' list indicates the factors that have been eliminated from the Current Factor list. You can inspect factors and see their tables by double-clicking any factor in the list.

There are two ways to eliminate a variable. One is to click on a highlighted node. The other way is to let the applet eliminate variables automatically. To let the applet eliminate variables automatically, the user should select an elimination order (random, sequential, or minfac, selectable from the left control panel) and either click 'step' to eliminate one variable, or 'auto-eliminate' to eliminate all variables.

The 'Remove Irrelevant Variables' button is used to remove variables that do not affect the node that is being queried.

Autoscale works the same way as the autoscale button in the main applet window. It rearranges the displayed network so that they fit optimally in the viewable area of the canvas.

The 'Reset Query' button resets the variable elimination.

The Inspecting Factors Window

When the user double-clicks a factor in the Verbose Query Window, the Inspecting Factors window is displayed. Here, the probability table for the factor is displayed.

The central area of the window is dominated by the factor table, displaying all possible combinations of the domains of all the variables, and their corresponding probabilities/values. The user can click on the value button to display how the probability/value is derived.

A choice box on the upper-right corner of the window allows the user to switch the view to another factor. There is also a 'Reorder Variable' button on the upper-left corner of the window that allows the user to rearrange the order of the variables that appear in the Inspecting Factors window. This is sometimes used to make it easier for the user to visually inspect variables.

The Independence Quiz Window

The Independence Quiz Window tests the user's knowledge of the conditional independence rules in a Bayes Network.

The Quiz Window has a large right canvas which displays the current Bayes Net. To ask a question, click the 'Ask New Question' button on the left control panel. Click nodes in this order: is conditionally independent of given and <4th node> and .... and ? - clicking at least two nodes to form a complete question. Click 'Get Answer' to let the applet answer the question.

The Quiz Window can also ask the user questions. Click on 'Answer New Question' to ask the applet to pose an independence question to the user. Click either true or false to give an answer, or click 'Get Answer' to ask the applet to solve the question. The window will keep track of the user's score for the duration of the session.

Autoscale works the same way as the autoscale button in the main applet window. It rearranges the displayed network so that they fit optimally in the viewable area of the canvas.

The XMLBIF Format

The applet can read an XML representation of a Bayesian Network called the XMLBIF format. The application version of the applet saves networks in this format

The DTD for XMLBIF is as follows:

<!DOCTYPE BIF [
        <!ELEMENT BIF ( NETWORK )*>
              <!ATTLIST BIF VERSION CDATA #REQUIRED>
        <!ELEMENT NETWORK ( NAME, ( PROPERTY | VARIABLE | DEFINITION )* )>
        <!ELEMENT NAME (#PCDATA)>
        <!ELEMENT VARIABLE ( NAME, ( OUTCOME |  PROPERTY )* ) >
              <!ATTLIST VARIABLE TYPE (nature|decision|utility) "nature">
        <!ELEMENT OUTCOME (#PCDATA)>
        <!ELEMENT DEFINITION ( FOR | GIVEN | TABLE | PROPERTY )* >
        <!ELEMENT FOR (#PCDATA)>
        <!ELEMENT GIVEN (#PCDATA)>
        <!ELEMENT TABLE (#PCDATA)>
        <!ELEMENT PROPERTY (#PCDATA)>
]>

This is an example XMLBIF (the fire alarm problem from the applet):

<BIF VERSION="0.3">
<NETWORK>

<VARIABLE TYPE="nature">
   <NAME>tampering</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (-148.1863, -197.12207)</PROPERTY>
</VARIABLE>

<VARIABLE TYPE="nature">
   <NAME>fire</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (67.29127, -200.31433)</PROPERTY>
</VARIABLE>

<VARIABLE TYPE="nature">
   <NAME>alarm</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (-46.03397, -61.451008)</PROPERTY>
</VARIABLE>

<VARIABLE TYPE="nature">
   <NAME>smoke</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (158.27069, -67.83553)</PROPERTY>
</VARIABLE>

<VARIABLE TYPE="nature">
   <NAME>leaving</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (-44.437843, 74.22005)</PROPERTY>
</VARIABLE>

<VARIABLE TYPE="nature">
   <NAME>report</NAME>
   <OUTCOME>T</OUTCOME>
   <OUTCOME>F</OUTCOME>
   <PROPERTY>position = (-42.841713, 200.31433)</PROPERTY>
</VARIABLE>


<DEFINITION>
   <FOR>tampering</FOR>
   <TABLE> 0.02 0.98</TABLE>
</DEFINITION>

<DEFINITION>
   <FOR>fire</FOR>
   <TABLE> 0.01 0.99</TABLE>
</DEFINITION>

<DEFINITION>
   <FOR>alarm</FOR>
   <GIVEN>tampering</GIVEN>
   <GIVEN>fire</GIVEN>
   <TABLE> 0.5 0.5 0.85 0.15 0.99 0.01 1.0E-4 0.9999</TABLE>
</DEFINITION>

<DEFINITION>
   <FOR>smoke</FOR>
   <GIVEN>fire</GIVEN>
   <TABLE> 0.9 0.1 0.01 0.99</TABLE>
</DEFINITION>

<DEFINITION>
   <FOR>leaving</FOR>
   <GIVEN>alarm</GIVEN>
   <TABLE> 0.88 0.12 0.0010 0.999</TABLE>
</DEFINITION>

<DEFINITION>
   <FOR>report</FOR>
   <GIVEN>leaving</GIVEN>
   <TABLE> 0.75 0.25 0.01 0.99</TABLE>
</DEFINITION>


</NETWORK>
</BIF>

A more extensive introduction to the Interchange Format for Bayesian Networks can be found at http://www-2.cs.cmu.edu/~fgcozman/Research/InterchangeFormat/