A. Introduction to Bayes Nets Copyright © 2023 Norsys Software Corp.

2. Using a Bayes Net

In this tutorial we will go step-by-step through some of the more common operations that a typical user will perform on a Bayes net. In Chapter 2 we will learn how to actually construct a net. For now, we restrict ourselves to using one that is supplied to us.

You can open a net with a ".dne" extension by simply clicking on it within your file manager. Or you can bring up Netica and open a pre-existing net file using the menu command: File->Open..., or the tool-bar button: .

Please open Asia.dne.

2.1 Compiling the net

When freshly opened, a Bayes net is uncompiled. This means that a junction tree for fast inference has not yet been built internally for the net. Here is how Asia.dne looks when freshly opened. Notice that only prior probabilities (probabilities before any evidence is entered) are displayed for each node, and that the belief-bars are gray.

To get any inference to take place, you must first compile the net. This is done by the menu command: Network->compile , or the tool-bar button: .

After compiling, the belief-bars turn black, but otherwise, there is no change. This is because we have not entered any evidence in the net. We have no specific knowledge about any of the variables in our world. All we have are the prior probabilities for those variables to work with, and so this is all that can be shown.

2.2 Entering findings

Findings are entered by clicking with the right mouse button on the node for which you have some finding information. A dialogue will appear near the mouse allowing you to click (either left or right mouse button) on the types of findings information that can be entered for that node. You can also use this dialogue to remove any evidence for a node's value: simply click on "Unknown".

2.2.1 positive state findings

For nodes that have a discrete number of states (see B.1.1 Discrete vs Continuous Variables), the available states are shown below the horizontal bar. Clicking on the particular state means our evidence is that our world is in this state. This is the most common way to enter a finding. Try entering findings in Asia.dne and watch what happens to the probabilities in the net. Here we show Asia after we have spoken to our patient and found out she is experiencing shortness of breath (Dyspnea):

Note that after entering the finding of Dyspnea=Present, the probability of Dyspnea for our patient is now 100%. The probabilities of all nodes that are not independent of Dyspnea will also be updated (an exception to this is if you have turned "auto-updating" off for your net (see Auto-Updating). Notice how shortness of breath increases the chances of all three diseases. Netica sets the background color of the nodes with evidence entered to gray.

Trick: To get a nice visual display of the affect a finding has on the net, you can alternately press the Undo ( or Ctrl-Z) and Redo ( or Ctrl-Shft-Z) buttons.

Terminology Note. Once some evidence has been entered in a net, all the probabilities are called a posteriori" probabilities, meaning "after" the given evidence. This is in contrast to a priori probabilities, which are those prior to any evidence.

2.2.2 negative findings

Sometimes you don't know explicitly that the world is in a particular state, but you do know that it cannot be in some states. Netica allows you to work with this sort of negative knowledge too. For example, say the node Temperature can take on the values of cold, medium, and hot. You may obtain information that the temperature is not hot. That is a single negative finding. If you receive another negative finding that the temperature is not medium, then you can conclude that it is cold. So several negative findings can be equivalent to one positive finding.

You can enter negative finding information only if the network is compiled and is being displayed with the belief-bar style (menu: Style->Belief-Bars). To do this, hold down the SHIFT key while you click on the name of the finding you know its not. If you click on additional names, they too are added to the list of state values that this node is not in. To reset the negative information, just right-button click and click on "Unknown".

Usually you will only bother with negative findings when a node has more than two states, although it is legal to enter a positive value of a 2-state (binary valued) node by entering it's alternate value negatively.

2.2.3 likelihood findings

Positive finding information is called "hard evidence". You know with certainty the state of a node. Another kind of evidence is called "soft evidence". That is where you don't know the node's value with certainty, but you have some idea of what values it can take on. Negative findings is a form of soft evidence. Another, more general form, is where you specify a "likelihood distribution" for the values of a node. This is just an array of probabilities, one for each possible state of the node. To give a likelihood finding, just right-button-click on the node, and click on "Likelihood". A dialog will appear which will ask you to enter a probability value for the first state. After entering that, you will be asked for a probability for the second state, and so on.

2.3 removing findings

If you want to remove findings for a particular node, right button click on it and choose "Unknown".

If you want to remove all the findings in the entire net (perhaps a new patient has just walked in), choose Network->Remove Findings, or use the shortcut button: ).

Return to Tutorial Home