General Help
Belief and Decision Networks

Back to help contents.

dotContents

Overview

Menu Help

Create Mode

Solve Mode

Node Legend

The Verbose Query Window

The Inspecting Factors Window

The Independence Quiz Window

The XMLBIF Format


dot 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.

dot Menu Help

The File Menu

The File Menu has options to create graphs, load files, and save files, as well as quitting the program.

  • Create New Graph - clears the currently loaded graph. All changes will be lost.

  • Load Sample Graph - allows the user to load from a selection of pre-generated examples.

  • Load From File - load a problem from the local disk.

  • Load From URL - allows the user to load a file over the Internet by typing in a URL.

  • Save Graph - saves the problem to the local disk.

  • Print - prints the network.

  • Quit - kills the applet.

The Edit Menu

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

  • View/Edit Text Representation (.bif format) - displays the .bif text representation of the Bayes Net. Note that this can only handle belief networks.

  • View/Edit Text Representation (.xml format) - displays the .xml text representation of the Bayes Net. This file format can handle both belief and decision networks.

The View Menu

The View Menu allows the user to modify the appearance of the applet.

  • Font Size - Set the font size used in the network.

  • Line Width - Set the width of lines displayed in the network.

  • Autoscale - Adjust the network to be fitted in canvas.

  • Enable Anti-Aliasing - enable or disable anti-aliasing.

  • Pan/Zoom - Select which mode to be in. Then when right-clicking and dragging the mouse on canvas, you can pan or zoom on the canvas.

  • Show Message Panel - Show or hide the message prompts above the main canvas.

  • Show Button Text - Show or hide the text on the buttons in the toolbar.

  • Show Buttons - Show or hide the removable toolbar buttons.

The Network Options

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

  • Query Modes - allows the user to set what query mode the applet should use when a node is queried or a network is optimized.

    • Brief Query Mode - the applet hides the variable elimination and just gives the user the results.

    • Verbose Query Mode - when a node is queried or the network is optimized, a window is pulled up that allows the user to manually do the variable elimination, and also allows the user to inspect factors as the elimination progresses.

    • Prompt for Query Mode - every time a query is done, the applet will pop up a dialog asking the user what query mode to use.
       

  • Decimal Places for Monitoring - this determines the accuracy that values are displayed when nodes are monitored. This is purely a convenience measure.

  • Belief/Decision Mode - sets the mode to belief networks or decision networks. It hides or shows the controls that allows decision nets to be created and solved, as belief nets do not need these controls. This defaults to belief networks, but the controls will show if a decision net is loaded.

dot 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.

  • Create Node
    Creates a node. When this button is depressed, clicking on the canvas will pull up a dialog asking the user for the node's name and domain (which defaults to T, F). If the Decision Net Controls are showing, the dialog will also ask for the node's type - either normal probability node, decision node, or utility node. Clicking the dialog's 'Done' button creates the node.

  • Create Arc
    Creates an arc. An arc represents probability dependency. To create an arc, depress this button, then click on the start node of the arc. Clicking on another node defines that node as the ending point of the arc. You cannot create arcs starting and ending on the same node.

  • Select
    Selects an entity for moving. To move an entity, click on an entity and drag it to a new position.

  • Delete
    Deletes a node or an arc. To delete an entity, depress this button and click on the node or arc that should be deleted.

  • Set Properties
    Sets the node properties. This pulls up the same dialog that is displayed when a node is being created, and it works the same way. To create the node properties, depress this button, and click on the node to be modified.

  • Modify Probability Table
    Changes the probability or utility tables (depending if the node is a normal probability node or a decision node). To change the table, depress this button and click on the node to be modified.

dot 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.

  • Make Observation
    allows the user to set a deterministic value to a node (instead of the originally set probabilities). Clicking on a node while this is depressed will pop up a dialog asking the user what domain element should be set to the node (like T or F).

  • Query
    allows the user to query a node's probabilities. Clicking on a node while this is depressed will either pop up a window detailing the solved probabilities (Brief Query Mode) or the Verbose Query window, which allows the user to manually do variable elimination.

  • P(e) Query
    allows the user to query the probability of observing the evidence given the model.

  • Toggle Monitoring
    Toggles whether or not probabilities are displayed on the nodes. This makes it easier to view changes in the probabilities as nodes are observed or when probabilities are changed. However, monitored nodes take up more space and thus create more clutter.

  • Select
    moves a node or an arc. To move a node/arc, click on a node/arc and drag it to a new position.

  • View Probability Table
    Allows the user to view (not edit) the probability or utility tables of nodes.

  • View/Modify Decision
    Allows the user to view the policy of a decision node after a decision network has been optimized. This also allows the user to change a decision node's policy. This button only appears if 'Decision Network Mode' in the Network Options menu is selected.

  • Add No-Forgetting Arcs
    Automatically adds no-forgetting arcs to a decision network. This button only appears if 'Decision Network Mode' in the Network Options menu is selected.

  • Optimize Decisions
    Optimizes a decision network by maximizing the value of the utility node. This is either done automatically (Brief Query mode) or in the Verbose Query window. This button only appears if 'Decision Network Mode' in the Network Options menu is selected.

  • Independence Quiz
    Pulls up the Independence Quiz window.

dot Node Legend

  • Red diamond nodes are utility nodes.

  • Orange rectangular nodes are decision nodes.

  • Blue circular nodes are normal probability nodes.

dot The Verbose Query Window

The Verbose Query Window allows the user to manually execute variable elimination. It has a large canvas area to the right and a control panel on the left.

The canvas area displays the current 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. When optimizing a decision network, the utility node is green.

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 clicking any factor in the list. When optimizing a decision network, there will also be a list of decision functions below the two factor lists.

There are five stages in the process of completing a query: 1) pruning irrelevant variables, 2) projecting observations, 3) eliminating variables, 4) multiplying final factors, and 5) normalizing final factors. These stages must be completed in order, although stages will be automatically skipped under certain conditions (for example, if there are no observations step two will automatically be skipped). These stages are listed on the left panel of the query window, and your current progress through the stages can be determined by the state of the buttons under each stage description.

It is possible to advance through the stages either by using the buttons on the left panel, or by directly interacting with the graph. You can interact with the graph by right clicking on the canvas and selecting an action, or by left clicking on nodes. Left clicking on a node has different behavior depending on the stage that you are in. For example, clicking on an observed node while you are in the "Project Observations" stage will project the nodes observation. You can rearrange the graph to make it easier to read by dragging nodes and using the autoscale option (right click on the canvas and select "Autoscale").

During the "Eliminate Variables" stage, there are two ways in which you can choose variables to eliminate. The 'Auto-Eliminate' button will eliminate all the variables in the order specified by the heuristic which is specified by the drop down menu next to 'Heuristic:'. The available heuristics are 'Max-Cardinality', 'Min-Degree', 'Min-Factor', 'Min-Fill', 'Random', and 'Sequential'. The 'Eliminate Next' button will eliminate a single variable each time you press it. The second way to choose variables to eliminate is by clicking on them directly. When you eliminate a variable, it will be greyed out, and the lists of current and eliminated factors will be updated accordingly.

dot The Inspecting Factors Window

When the user clicks on 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.

dot The Independence Quiz Window

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

The Quiz Window has a large right canvas which displays the current network. Their are two modes which can be changed by clicking on the the tab at top, right hand side. You can either 'Quiz Yourself' by asking user questions or 'Ask the Applet' to create a question to ask the applet .

To quiz yourself, click on the tab 'Quiz Yourself'. Click on 'Answer a 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.

To ask a question, click the 'Ask the Applet' tab. Click on the 'Ask a question' button on the left control panel. Click nodes in this order:
 [1st node] is conditionally independent of [2nd node] given [3rd node] and [4th node] and .... and [nth node]?
Click at least two nodes to form a complete question. Click 'Get Answer' to let the applet answer the question.

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.

dot 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/

Valid HTML 4.0 Transitional