Bayesian Belief and Decision Networks |
|
Overview
Menu Help
Create Mode
Solve Mode
Node Legend
The Verbose Query Window
The Inspecting Factors Window
The Independence Quiz Window
The XMLBIF Format
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.
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.
Create New Graph - clears the currently loaded graph. All changes since the last save (if possible) will be lost.
Load Sample Graph - allows the user to load from a selection of pregenerated examples.
Open Location - allows the user to load a file over the Internet by typing in a URL.
Quit - Kills the applet.
The Edit Menu allows the user to view a text representation of the Bayesian network.
View/Edit Text Representation (.bn format) - displays the .bn text representation of the Bayes Net. This file format can handle both belief and decision networks.
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 Graph Options menu allows the user to change the appearance of the applet display.
Font Size - changes the font size of the display.
Line Width - changes the line thickness of the canvas display.
Show Control Panel - hides/displays the left control panel. Default is ON.
Show Message Panel - hides/displays the text area in the bottom of the canvas. Default is ON.
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.
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.
Show Decision Net Controls - 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 OFF, but the controls will show if a decision net is loaded.
Show Quiz Controls - hides or shows the controls for the Independence Quiz window. Default is OFF.
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 radio 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 value 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 radio 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.
Move Node
Moves a node. To move a node, click on a node and drag it to a new position.
Delete Entity
Deletes a node or an arc. To delete an arc, depress this radio button and click on the node or arc that should be deleted.
Set Node Properties
Sets the node properties. This pulls up the same dialog that is pulled up when a node is being created, and it works the same way. To create the node properties, depress this radio button, and click on the node to be modified.
Modify Probability / Modify Probability/Utility
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 radio button and click on the node to be modified.
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 Node
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.
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.
Move Node
moves a node. To move a node, click on a node and drag it to a new position.
View Probability Table / View Probability/Utility
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 radio button only appears if 'Show Decision Net Controls' in the Query Control Options is set to ON.
Add No-Forgetting Arcs
Automatically adds no-forgetting arcs to a decision network. This radio button only appears if 'Show Decision Net Controls' in the Query Control Options is set to ON.
Optimize Decisions
Optimizes a decision network by maximizing the value of the value node. This is either done automatically (Brief Query mode) or in the Verbose Query window. This radio button only appears if 'Show Decision Net Controls' in the Query Control Options is set to ON.
Independence Quiz
Pulls up the Independence Quiz window. This button only appears if 'Show Quiz Controls' in the Query Control options is set to ON.
Autoscale
rearranges the displayed network so that they fit optimally in the viewable area of the canvas. It should be noted that when there are a lot of nodes to be displayed, the view area will be cluttered.
Red diamond nodes are value nodes.
Yellow rectangular nodes are decision nodes.
Blue circular nodes are normal probability nodes.
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.
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 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
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 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/