The add state function is fast and easy to use when editing a node table manually. However, if you are using expressions, you will have to edit the states using the Node Properties dialog because states are not visible in the node edit pane.
![]() |
Figure 1: The add state tool button from the edit mode tool bar. |
The add state function adds a new state/decision to the node currently active in the node edit pane (only discrete chance nodes and decision nodes). If the currently active node is a discrete chance node, this state is named "State n" (where n is the total number of states of the node after the new state has been added). If the currently active node is a decision node, the decision/action is named "Action n"
![]() |
Figure 2: The sub items of Align in the Options menu. |
The four "Align" sub items are used for aligning a series of nodes to the same horizontal or vertical line. The line is specified by "Left", "Right", "Top", or "Bottom". The "Align" sub items can only be activated if two or more nodes are currently selected. When an "Align" sub item is activated, all the currently selected nodes are placed on the specified line. If for example the "Align Right" sub item is activated, the specified line is the vertical line though the right most node in the series of selected nodes ("Align Left" specifies a vertical line through the left most selected node, while "Align Top" and "Align Bottom" specifies horizontal lines through the top most and bottom most selected nodes respectively).
If the specified line is a vertical line the selected nodes keep their horizontal coordinate and if it is a horizontal line they keep their vertical coordinate.
The "Snap to Grid" sub item of the "Align" item moves all nodes to the nearest point in the specified grid.
Approximation is activated in the Compilation tab of the Network Properties dialog box. This functions works by eliminating the smallest table values of the internal network representation (making them zero), so that the compression function will be more efficient (compression can save space when there are a lot of zero probabilities).
To specify which table values to eliminate, you must set an epsilon value which specifies how much probability mass to eliminate. Then, small table values are set to zero - from the smallest end, until you have removed an amount of epsilon probability mass.
You should be careful when using approximation. It can cause conflicts when rare cases occur, since small (though existing) probability mass has been eliminated.
![]() |
Figure 3: The arrange icons tool button from the main window tool bar. |
The arrange icons function places all iconized network windows in a row in the bottom of the main window.
Auto propagation makes hugin propagate automatically with a specific propagation method every time you enter new evidence.
![]() |
Figure 4: The Network Properties dialog box showing the Auto Propagate tab. |
In the Auto Propagate tab you can select one of two radio buttons to specify if you want to use auto propagation or not. If you choose auto propagation, you can also specify which propagation method you want to use. In most cases you would want to stick with Sum Normal.
![]() |
Figure 5: The Network Properties dialog box showing the Auto Propagate tab. |
If auto update graph is enabled, the graphs in the monitor windows of continuous chance nodes will automatically be updated when new evidence is entered. This can be very helpful on small networks but should not be used on larger networks because it can be very time consuming.
You can resize this bar length by moving the mouse cursor over the right end of this bar length indicator and dragging it horizontally. You can also resize it by activating Size Bar Length from the View menu.
In Hugin Bbns, you can represent two kinds of random variables: discrete chance nodes having a discrete finite state space and continuous chance nodes having a continuous infinite state space.
For the discrete chance nodes, the function describing how the node depends on its parents is a conditional probability table. For continuous chance nodes it is a pdf (in Hugin it must be a Gaussian normal distribution function).
In Hugin, you can also compose influence diagrams which are Bbns extended with decisions and a utility function.
A Bayesian belief network (Bbn) is really just a smart representation of a domain of dependent random variables.
Many real life situations can be modelled as a domain of random variables (you could model a group of related deceases: risk factors, deceases, and symptoms). A domain of random variables could form the basis of a decision support system to help actors decide what would be most beneficial in a given situation.
If you wanted to represent a domain of random variables (all having a discrete and finite state space), you could always do this by the joint probability table of the entire domain. That is, a table with an entry for each configuration of the nodes of the domain. However, the number of configurations of a domain grows exponentially in the number of random variables so this would only work for very small domains.
What you use to keep the representation size to a minimum in Bbns is the conditional independencies in the domain: Very often the knowledge about a random variable being in a specific state will make other variables independent and thus it would be overkill to have an entry for all combinations of these independent variables (they would all contain the same value).
This is not the right place to describe the theory behind Bbns in detail. You should be able to find some useful literature about the subject elsewhere. Here is a place to start: Finn V. Jensen: "An Introduction to Bayesian Networks" - May 1996.
![]() |
Figure 6: The sub items of Belief Precision in the View menu. |
The first sub item is Max Precision which when selected displays all beliefs as numbers between 0 and 1 with up to six significant digits (single precision values). In influence diagrams, expected utilities are displayed also with up to six significant digits.
The five "Percent" sub items enables display of beliefs as numbers between 0 and 100 (percent). Each of these sub items specifies a specific number of digits following the decimal point. Currently HUGIN Runtime does not allow these display modes for influence diagrams and when continuous nodes appear in the network.
The last sub item is "No Belief Values". This disables the display of belief values. In stead, only the graphical display of beliefs is used. Currently HUGIN Runtime does not allow you to disable display of beliefs and expected utilities for influence diagrams and when continuous nodes appear in the network.
![]() |
Figure 7: The cascade windows tool button from the main window tool bar. |
The cascade windows function arranges the network windows in the main window in a cascade (window upon window upon window...).
Based on the current conditional probability distribution Hugin Runtime
can generate cases and save these into a file.
Cases can be
generated in two different ways: MCAR (Missing Completely at Random)
or MAR (Missing at Random).
MCAR sets
some values to N/A by removing values of some nodes in the generated case
set randomly (i.e. MCAR considers all the values in the generated cases and not
one case at a time).
MAR randomly
sets some values in a case to N/A based on auto-generated templates.
These templates specify that if some nodes have a specific value then randomly
set the values of a subset of the nodes in this case to N/A. Note that
the specification of the templates is generated randomly.
It defines a causal dependency from the parent node to the child node. That is, the state of the parent has impact on the state of the child.
It can sometimes be difficult to determine what is a causal dependency and what is not. Eg. imagine you have two nodes: One for "Red Spots" and one for "Measles". Some might say that when you observe red spots on a child it is very likely that the child has measles so you should add a link from "Red Spots" to "Measles". This, however, is terribly WRONG! The relation between red spots and measles is that measles causes red spots. The link should go from "Measles" to "Red Spots" (because it is a causal arrow).
Always make sure that the causal arrows you add are causal.
The close function closes the currently active network window. If there has been changes to the network of this network window, the user is asked if he/she wants to save these changes before the network window is closed.
The close all function closes all network windows currently open in the main window. If there has been changes to the network of a network window, the user is asked if he/she wants to save these changes before this network window is closed.
![]() |
Figure 8: The collapse node list tool button from the run mode tool bar. |
The collapse node list function disables the display of states/decisions and their belief/expected utility in the node list pane.
You can collapse a single node in the node list by clicking it with the mouse.
This function has an inverse in the expand node list function.
![]() |
Figure 9: The compile tool button from the network window tool bar. |
You can also activate the compile function from run mode. Here, the Run Mode item of the Network menu is replaced with the Recompile item.
When activating the compile function from edit mode, the current network is compiled and run mode is entered.
When activating the compile function from run mode, the current network is recompiled (this can sometimes be useful).
The compilation of a HUGIN network is basicly a transformation from the Bayesian belief network form to the junction tree form in which the propagations can take place. The theory behind the transformation to a junction tree is not covered in this manual.
You can specify certain properties on the compilation in Hugin from the Network Properties item of the Network menu. Figure 10 shows the Compilation tab of the Network Properties dialog box.
![]() |
Figure 10: The Network Properties dialog box showing the Compilation tab. |
Generally, it is NP hard (mathematical way to say that it is impossible within reasonable time) to find the best internal representation of a Hugin network (the junction tree representation). This is basically because it is NP hard to triangulate a graph optimally. The triangulation methods listed in the Compilation tab are different heuristic methods to perform the triangulation step of the compilation process. In some cases one method will be the best - in other cases another one will. If you have a Hugin network which is rather complex and seems to have poor performance, you might try another triangulation method.
You can sometimes save some space by using the optimization facilities. These are activated in the bottom half of the Compilation tab. You can choose between ordinary compression and compression involving approximation. The latter will cause less precision while the first will not.
If you select Approximate, you must also specify an epsilon value stating how much loss of precision you will allow. The larger epsilon value you specify, the less precision (read more about this in the Approximate section).
Compression will optimize the way the tables of the internal representations are stored. Basically, you can save space any time a table entry has a zero value (probability). This means that the more zero-probabilities you find in the tables of your Hugin network, the more effect will you get from using the compression option.
You can compress even more using approximation (if you are willing to work with less precision).
Only if you have chosen to specify the table manually (alternative to using expressions), you can see the entire cpt. Otherwise, you see the table of expressions specifying the table.
The table shown in the node edit pane is different depending on the type of the currently selected node:
Figure 11 shows a cpt for a discrete chance node with one parent (Color).
![]() |
Figure 11: The cpt of a node with one parent (Color). |
The states of the currently selected node are those found in the left most column below the parent labels. You can change these state names by selecting them with the mouse cursor and typing in a new name from the keyboard.
Each numeric value in the cpt is the probability of the currently selected node being in the state found in the left most column in the actual row - when the parents (if any) are in the states found in the top of the actual column.
You can change a specific numeric value by selecting it with the mouse cursor and typing in a new value from the keyboard.
Currently, there are some restrictions to the use of continuous chance nodes, partly because the underlying theory is still being developed. The restrictions are listed below:
![]() |
Figure 12: The continuous chance tool button from the edit mode tool bar. |
When the continuous chance tool is activated (when the continuous chance tool button is pressed) you can place a continuous chance node in the network pane: Simply click the mouse somewhere within the network pane. When you have placed the continuous chance node the select tool is normally activated again. If you want to keep the continuous chance tool activated (to create a series of nodes) hold down the SHIFT key while placing a node.
![]() |
Figure 13: The copy tool button from the main window tool bar. |
The copy function has two meanings:
When you cut a selected sub network, all internal links in the sub network are copied to the clipboard. Also links from external nodes to nodes within the selection are copied and can be restored when pasting. Links from nodes within the selection to external nodes, however, are not copied.
When pasting a sub network from the clipboard, a link from an external node to a node within the sub network is restored if the external node "exists" in the new network. Here, we say that a node "exists" if a node appears with the same node name as the external node in the original HUGIN network. The external node in the new network needs not have the same node label as the external node in the original network. If the external node does not "exist" in the new network, the link is not restored. This has impact on the conditional probability table of the node which the link pointed to and one should reconstruct it.
You can also use paste functions in other applications with the HUGIN network currently on the clipboard. This makes it easy to create figures for documentation reports.
![]() |
Figure 14: The copy tool button from the main window tool bar. |
When you have copied a node or state of a node as a DDE link, you can paste it in another program using "Paste special" (Excel) or equivalent. This creates a DDE connection from the probabilities calculated in HUGIN Runtime to the other program.
![]() |
Figure 15: The cut tool button from the main window tool bar. |
The cut function can only be activated in edit mode and when one or more nodes or causal arrows are selected in the network pane.
The selected sub network will be deleted from the network pane and copied to the clipboard when the cut function is activated. Then you can paste this sub network to other open HUGIN networks or you can paste it in other applications having access to the clipboard.
When you cut a selected sub network, all internal links in the sub network are copied to the clipboard. Also links from external nodes to nodes within the selection are copied and can be restored when pasting. Links from nodes within the selection to external nodes, however, are not copied.
When pasting a sub network from the clipboard, a link from an external node to a node within the sub network is restored if the external node "exists" in the new network. Here, we say that a node "exists" if a node appears with the same node name as the external node in the original HUGIN network. The external node in the new network needs not have the same node label as the external node in the original network. If the external node does not "exist" in the new network, the link is not restored. This has impact on the conditional probability table of the node which the link pointed to and one should reconstruct it.
You establish a DDE connection with the following application, topic, and item:
You can easily copy a DDE link to the clipboard using the copy function. See the Copy DDE Link section to read more about this.
![]() |
Figure 16: The red circle shows the DDE indicator in the status bar of the main window. Here, it indicates that there is at least one DDE connection to another application. |
A Bbn extended with decision nodes and utility nodes are called href="#influence_diagram">influence diagrams. The decision nodes represent decisions controlled by an external user. This means that compared to discrete chance nodes decision nodes has no conditional probability table. In the influence diagram monitor windows for decision nodes and node list pane show the expected utility of choosing each decision (in stead of probabilities as in discrete chance nodes).
Decision nodes cannot appear in a network together with continuous chance nodes.
Decision nodes are assigned a type.
![]() |
Figure 17: The decision tool button from the edit mode tool bar. |
When the decision tool is activated (when the decision tool button is pressed) you can place a decision node in the network pane: Simply click the mouse somewhere within the network pane. When you have placed the decision node, the select tool is normally activated again. If you want keep the decision tool activated (to create a series of nodes) hold down the SHIFT key while placing a node.
![]() |
Figure 18: The delete tool button from the main window tool bar. |
The delete function can only be activated in edit mode and when one or more nodes or causal arrows are selected in the network pane.
The selected sub network will be deleted from the network pane. It will not be copied to the clipboard. The cut function is very similar to delete but cut copies the deleted sub network to the clipboard.
The delete state function is fast and easy to use when editing a node table manually. However, if you are using expressions, you will have to edit the states using the Node Properties dialog because states are not visible in the node edit pane.
![]() |
Figure 19: The delete state tool button from the edit mode tool bar. |
The delete state function deletes a state/decision of the node currently active in the node edit pane. The delete state function only works for discrete chance nodes and decision nodes (in decision nodes it deletes a decision/action).
The delete state function can only be activated when the currently selected node has two or more states.
When propagating, you can see the probabilities of each state in a discrete chance node either in the node list pane or by opening a monitor window for the node.
In an influence diagram, discrete chance nodes depending on a decision node cannot be properly calculated before the decision has been made. This means that one should never use the probabilities displayed for such nodes.
Discrete chance nodes are assigned a type.
![]() |
Figure 20: The discrete chance tool button from the edit mode tool bar. |
When the discrete chance tool is activated (when the discrete chance tool button is pressed) you can place a discrete chance node in the network pane: Simply click the mouse somewhere within the network pane. When you have placed the discrete chance node the select tool is normally activated again. If you want keep the discrete chance tool activated (to create a series of nodes) hold down the SHIFT key while placing a node.
![]() |
Figure 21: The Network Properties dialog box showing the Display tab. |
At the top of the Display tab you can specify the width and height of the nodes in the network pane. You can also specify a different font of the node labels. In the bottom you can set up a grid used in the network pane to help arranging the nodes.
The Edit menu contains items covering functions mainly for constructing a HUGIN network. This means that most of them are only active in edit mode. Some of them, however, can also be used in run mode. In run mode, the Copy item can take another meaning when a node or a state of a node is selected in the node list pane: It changes its label to Copy DDE Link and it is now used for establishing DDE connections with other applications.
![]() |
Figure 22: The contents of the Edit menu |
![]() |
Figure 23: The network window of a HUGIN network running in edit mode. |
You go from run mode to edit mode by pressing the edit mode tool button (see figure 24).
![]() |
Figure 24: The edit mode tool button from the run mode tool bar. |
![]() |
Figure 25: The enter likelihood tool button from the run mode tool bar. |
Entrance of likelihood can only be used on discrete chance nodes.
Entrance of likelihood is what you do when you learn something about the state of the world which can be entered into a variable of your network. The simplest form is for example when you have a variable "Ball Color" stating the color of a ball drawn from a basket of red and blue balls. This variable has states "red" and "blue". Then, when you see the color of the ball is actually blue, you can enter this fact by saying that "Ball Color" takes state "blue". The easiest way to enter this is by using the select state function. However, you can also do it by entering likelihood. That is, you want to enter the fact that the probability of "Ball Color" being in state "blue" is 1 while the probability of "Ball Color" being in state "red" is 0.
When you have activated the enter likelihood function, the dialog window shown in figure 26 apears. Here, you can enter additional information that you might have come over.
![]() |
Figure 26: The likelihood dialog window. |
In the case of figure 26, we have a variable called "# Red Balls" counting the number of red balls in a basket containing 3 balls of which some are blue and some are red. If you have taken two balls up from the basket and both of these were blue, you know that at most 1 ball in the basket is red. This information can be given to the network by entering likelihood into the "# Red Balls" variable as we have done in figure 26. We give "0 balls" and "1 ball" equal positive probability while "2 balls" and "3 balls" get probability 0.
In the likelihood dialog window, you have a Node area and a Likelihood area. In the Node area, the label of the node is found. In the Likelihood area, there is a display showing what you have entered so far. Here, you can drag the bars representing a probability back and forward with the mouse. Below this display is a select field where you can choose between different standard probability values (0, 0.1, 0.33333, 0.5, etc.). Choosing one of these values will make the currently selected state in the display take this value as probability.
Below the display in the Likelihood area are also two buttons labelled "All 1" and "All 0". Pressing one of these makes all states in the display take values 1 or 0 respectively.
You should not be concerned with the fact that the sum of all probabilities are not necessaryly 1. HUGIN will normalize the values so that for example in the case shown in figure 26, "0 Balls" and "1 Ball" each get probability 0.5.
The exit function closes all network windows and exits from HUGIN Runtime. Each time a network window is closed, HUGIN Runtime asks you to save the network of this window.
![]() |
Figure 27: The expand node list tool button from the run mode tool bar. |
The expand node list function enables the display of states/decisions and their belief/expected utility of all nodes in the node list pane.
You can expand a single node in the node list by clicking it with the mouse.
This function has an inverse in the collapse node list function.
The Expression Builder assists the user in building expressions by providing a simple user interface for selecting a function and specifying arguments. When the user selects Build Expression, a dialog window appears showing all functions available for the currently edited expression (depending on the type of the currently selected node). This dialog is shown in figure 201. The functions are organized in a number of categories to make it faster to find a particular function.
![]() |
Figure 201: The Select Function dialog of the Expression Builder. |
After the user has selected a function the Specify Arguments dialog of the Expression Builder appears. This dialog prompts the user for arguments to the selected function. Figure 202 shows the Specify Arguments dialog.
Each argument must itself be an expression and can therefore be built using the Expression Builder. Pressing the Build button next to the argument edit box will start the Expression Builder for that argument.
If you want to use a parent in an expression, you must use its unique name. You can select a parent in the Parents list and then press the Insert button to insert it into the argument you are currently editing. Only discrete chance nodes and decision nodes can appear in expressions.
![]() |
Figure 202: The Specify Arguments dialog of the Expression Builder. |
From manual table editing mode you can switch to expression editing mode by selecting the Expressions item of the Table menu. You can also select the Specify Expressions button in the Table tab of the Node Properties dialog.
If you have chosen to edit the table of a discrete chance node or utility node in expression mode, you will see the label "Expression" in the left most column, below the parent labels (if any). Figure 210 shows the expression table of a discrete chance node in the node edit pane.
![]() |
Figure 210: The node edit pane showing the expression table of a discrete chance node. |
In expression mode, you can type in expressions in the table fields. If you are not that familiar with the expression language, you can use the node types are introduced.
The functions specified by expressions also differ in that some are deterministic functions specifying the exact state of a node, eg: nPeople = "nMen + nWomen" whereas others are distribution functions specifying the probability distribution of the states, eg: P(nSix) = "Binomial(nDice, 1/6)". There are a limited number of distribution functions available so Hugin will know how to interpret the expression you write.
The building blocks available for expressions are listed below.
State labels must be encapsulated in quotation characters (").
Numeric values are typed in as you would probably expect to do - without any encapsulating characters or other formatting stuff: Eg. "X + 3.4" (here, the quotation characters are used only to separate the expression from the rest of the text - it has nothing to do with state labels as discussed above).
There are two Boolean constant values: "false" and "true". Notice that the Boolean constants must be lower case.
Function | Node requirements | Comments | Arguments | Arg. range |
Binomial | Numbered: 0, 1, 2, ... , n | n | 0, 1, 2, ... | |
p | [0,1] | |||
Poisson | Numbered: 0, 1, 2, ... , n | n will get prob. mass of n, n+1, ... | Mean | ]0, inf[ |
Geometric | Numbered: 0, 1, 2, ... , n | n will get prob. mass of n, n+1, ... | p | [0, 1] |
Function | Node requirements | Comments | Arguments | Arg. range |
Normal | Interval. First state must start in -inf. Last interval must end in inf. | Mean | ]-inf, inf[ | |
Variance | ]0, inf[ | |||
Beta | Interval. First state must start below Lower. Last interval must end after Upper (see arguments). | If not specified, arguments Lower and Upper will be 0 and 1, respectively | Alpha | ]0, inf[ |
Beta | ]0, inf[ | |||
Lower (optional) | ]-inf, Upper[ | |||
Upper (optional) | ]Lower, inf[ | |||
Gamma | Interval: First state must start below 0. Last interval must end in inf. | Shape | ]0, inf[ | |
Scale | ]0, inf[ | |||
Exponential | Interval: First state must start below 0. Last interval must end in inf. | Lambda | ]0, inf[ | |
Weibull | Interval: First state must start below 0. Last interval must end in inf. | Shape | ]0, inf[ | |
Scale | ]0, inf[ | |||
Uniform | Interval: The state intervals must cover Lower and Upper - at least in end points (see arguments). | Lower | ]-inf, Upper[ | |
Upper | ]Lower, inf[ |
+ (sum) |
- (subtract) |
* (multiply) |
/ (divide) |
power |
min |
max |
log |
negate |
log |
exp |
sqrt |
The first four arithmetic functions (operators) use infix notation: "A + B". The rest have prefix notation: "max(A, B, 0.7)".
and |
or |
not |
Boolean functions have infix notation: "and(or(X, Y), A, B)".
= (equals) |
!= (equals not) |
< (less than) |
> (greater than) |
<= (less than or equals) |
>= (greater than or equals) |
All comparison operators can be used to compare numeric values. The equality comparison operators (= and !=) can also be used to compare Boolean values and labels. All comparison operators use infix notation: "A = 14".
The if-then-else function can be used to combine both deterministic functions and distribution functions. Eg. if you are building a system for predicting how many times you will roll six with a number of dice, you could be in a situation where you were uncertain about whether the dice were fair or not, having probability 1/6 and 1/2 for rolling six respectively. If you have a Boolean node "DiceFake" representing this uncertainty, you could specify one of these two expressions:
"Binomial(nDice, if(DiceFake, 1/2, 1/6))"
or
"if(DiceFake, Binomial(nDice, 1/2), Binomial(nDice, 1/6)"
The File menu contains items covering functions for manipulating network files (open, close, save, etc.).
![]() |
Figure 28: The File menu. |
The Gaussian normal distribution function is defined on the complete real axis. Any Gaussian normal distribution function can be specified by its mean and variance parameter. In HUGIN, a continuous chance node can have a single Gaussian normal distribution function for each configuration of its discrete parents states (both discrete chance nodes and decision nodes). If a continuous chance node has one or more continuous chance node as parent, the mean can be linearly dependent of the state of the continuous chance node parents.
In figure 30 is shown an example of the specification of a Gaussian normal distribution function of a continuous chance node (C3) having one discrete chance node (C1) and one continuous chance node (C2) as parents (see figure 29).
![]() |
Figure 29: An example of a Bbn where the continuous chance node C3 has one discrete chance node (C1) and one continuous chance node (C2) as parents. |
![]() |
Figure 30: The specification of a Gaussian normal distribution function for C3 having one discrete chance node (C1) and one continuous chance node (C2) as parents. |
This specification gives a Gaussian normal distribution function for each of the states of C1 (where N(m,v) is the Gaussian normal distribution function with mean m and variance v):
Only the mean depends linearly on a continuous parent node. The variance is constant for each configuration of the states of the discrete parents.
![]() |
Figure 31: The Help button of the main window tool bar. |
![]() |
Figure 32: The graphical display button from the edit mode tool bar. |
You can specify/edit the groups of your network in the Groups and Colors tab of the Network Properties dialog box. This tab is shown in figure 33.
![]() |
Figure 33: The Network Properties dialog box showing the Groups and Colors tab. |
When you use Hugin, you always use four default groups (maybe without recognizing them as groups). Each of the different types of nodes have their own default group: discrete chance nodes, continuous chance nodes, utility nodes, and decision nodes.
You add a new (user defined) group by typing the new group name in the small edit box below the list of groups and clicking the Add button to the right of the edit box. You can also rename a group, delete it, or move it up and down in the node groups list.
At the bottom of the Groups and Colors tab, you can change the color of the currently selected group in the groups list: Simply click the new color in the color palette.
You can assign one or more nodes in the network pane to a group by selecting them and clicking the right mouse button which opens a menu. From this menu, use the Assign to Group item to select a group. This way you can also remove a node from a specific group by selecting the No Group sub item of the Assign to Group item. You can assign nodes to groups in both edit mode and run mode since this has no real influence on the network structure.
![]() |
Figure 34: The red circle shows the group indicator in the status bar of the main window. Here, it indicates that there is at least one user defined group. |
The Help menu contains items for different kinds information about Hugin Runtime. Figure 35 shows the Help menu.
![]() |
Figure 35: The Help menu. |
An influence diagram cannot contain continuous chance nodes.
An influence diagram should be constructed so that one can see exactly which variables (represented by discrete chance nodes) are known at the point of deciding for each decision node. If the state of a chance node will be known at the time of making a decision, this will (probably) have an impact on what the decision maker should do. Thus, one must add a link from the chance node to the decision node. If the state of a chance node will be known before some given decision, and this chance node has impact on another chance node which is also known before the decision, only the last chance node needs to have a link to the decision node. That is, there only needs to be a directed path from a chance node to a decision node if the chance node is known before the decision is made.
In an influence diagram, there must also be an unambiguous order among the decision nodes. That is, there can be only one sequence in which the decisions are made. In the same way as when defining that a chance node will be known before a decision is made, we add links to show which decisions have already been made when a specific decision is made. Again there only need to be a directed path from one decision node to the next one in the decision sequence.
If the influence diagram is not constructed correctly according to the rules stated above, the calculated expected utilities will (of course) not be correct.
When propagating, you can follow the expected utility of choosing each decision in the next decision node in the decision sequence either in the node list pane or by opening a monitor window for the decision node. The utilities shown in a decision node further down in the decision sequence should not be considered before all previous decisions have been made. This simply makes no sence.
![]() |
Figure 36: The Information tool button in the main window tool bar. |
When the information function is activated, a dialog window appears with two possible tabs. The first tab is labeled "Compilation Log". Under this tab you can see the output comments generated during compilation. Figure 37 shows this tab.
![]() |
Figure 37: The Compilation Log tab of the Information dialog window. |
The second tab is labeled "DDE Connections". Here, you can see all DDE connections from your HUGIN network to other applications. In Figure 38 we see an example where the node C3 has a DDE link from one of its states to another application.
![]() |
Figure 38: DDE Connections tab of the Information dialog window. |
![]() |
Figure 39: The Initialize tool button in the run mode tool bar. |
The initialize function retracts all findings entered in the current HUGIN network.
The
adaptation algorithm (sequential updating) will update the conditional
probability distribution of a Bayesian belief network in the light of inserted
and propagated evidence (i.e. experience). The adaptation algorithm only applies
to the discrete chance nodes. The algorithm is useful when the graphical
structure and an initial specification of the conditional probability
distributions are present but the modelled domain changes over time, the model
is incomplete, or the model simply does not reflect the modelled domain
properly.
In this section we give a quick overview of sequentially
update the conditional probability tables. It is assumed that the reader is
familiar with the methodology of Bayesian belief networks and influence diagrams
as well as usage of Hugin Runtime (the graphical user interface).
The basic concept of
Bayesian belief is described in basic concepts
section. You can also learn more about influence diagrams in the same
section. To get an introduction to Hugin Runtime refer to A
Small Bayesian Belief Network.
The sequential updating also known as adaptation or sequential
learning makes it possible to update and improve the conditional probability
distribution for a domain as observation are made. Adaptation is especially
useful if the model is incomplete, the modelled domain is drifting over time, or
the model quite simple does not reflect the modelled domain properly. Note that
the graphical structure and an initial specification of conditional probability
distribution must be present prior to adaptation.
The adaptation algorithm implemented in Hugin is developed by
Spiegelhalter and Lauritzen [Spiegelhalter&Lauritzen90].
See also [Cowel&Dawid92]
and [Olesen
et.al.92] for a more detailed mathematical description of the algorithm.
Spiegelhalter and Lauritzen introduced the notion of experience.
The experience is quantitative memory which can be based both on quantitative
expert judgment and past cases. Dissemination of experience refers to the
process of calculating prior conditional distributions for the variables in the
belief network. Retrieval of experience refers to the process of
calculating updated distributions for the parameters that determine the
conditional distributions for the variables in the belief network.
In short the adaptation algorithm will update the conditional
probability distribution of a Bayesian belief network in the light of inserted
and propagated evidence (i.e. experience). Note that adaptation can only be
applied to discrete chance variables.
The experience for a given discrete chance node is
represented as a set of experience counts Alpha0,...,Alphan-1,
where n is the number of configurations of the parents of the node
and Alphai > 0 for all i; Alphai
corresponds to the number of times the parents have been observed to be in the ith
configuration. However, note that the “counts” do not have to be
integers – they can be arbitrary (positive) real number, thus the counts are
only conceptual. The experience counts are stored in a table, experience
table.
When an experience table is created, it is filled with zeros. Since
zero is an invalid experience count, positive values must be stored in the
tables before adaptation can take place. The adaptation algorithm will
only adapt conditional distributions corresponding to parent configurations
having a positive experience count. All other configurations (including all
configurations for nodes with o experience table) are ignored. This convention
can be used to turn on/off adaptation at the levee of individual parent
configurations: setting an experience count to positive number will turn on
adaptation for the associated parent configuration; setting the experience count
to zero or a negative number will turn it off.
Experience tables can be deleted. Note that this will turn off
adaptation for the node associated with the experience table and the initial
conditional distribution will be equal to conditional distribution of the node
at the deletion time.
The
adaptation algorithm also provides an optional fading feature. This
feature reduces the influence of past (and possibly outdated) experience in
order to let the domain model adapt to changing environments. This is achieved
by discounting the experience count Alphai by
a fading factor Deltai, which is a positive real number
less than but typically close to 1. The true fading amount is made proportional
to the probability of the parent configuration in question. to be precise: if
the ith parent given the propagated evidence is pi,
then Alphai is multiplied by (1-pi)+piDeltai)
before adaptation takes place. Note that the experience counts corresponding to
parent configurations that are inconsistent with the propagated evidence (i.e.
configuration with pi = 0) remain unchanged.
This section describes the feature of using data (i.e. a set of cases) to "learn" the conditional probability distributions when only the graphical structure is given. This is known as batch learning. Note that if the initial conditional probability distributions are also given it is still possible to use batch learning.
Batch learning requires that all
data is available when the learning process starts, whereas sequential learning
allows the knowledge to be updated incrementally but sequential learning
requires that an initial assessment of the conditional probabilities is given whereas batch learning
only requires the graphical structure. The batch learning method
currently implemented in Hugin is called EM-algorithm or EM-learning
and was developed by Lauritzen [Lauritzen95]
see also [Cowel&Dawid92].
A case is an assignment of values to
some or all the nodes of a domain. If values have been assigned to all nodes,
the case is said to be complete; otherwise, it is said to be incomplete.
The data used by the learning algorithm is comprised of a set of cases. The
cases are numbered sequentially from 0 to N-1, where N
is the total number of cases.
Although the learning algorithm currently
implemented in Hugin cannot learn conditional distributions for continuous
nodes, such nodes can contribute to the beliefs of the discrete (chance) nodes.
Hence, the Hugin also provides functions for entering and retrieving values for
continuous nodes.
Before learning can take place, in addition to the data
set, the set of nodes for which conditional probability distributions should be
learned must be specified. This set is specified as the set of nodes having experience
tables (described in previous section). The input to the learning algorithm
is the case data; this set of cases must be non-empty. Note
that if the domain is an influence diagram model, then the domains decision
nodes must be instantiated in all cases.
The learning algorithm needs to do inference, so the domain
must be compiled before the learning algorithm is called. If successful, the
procedure will update the conditional probability and the experience table for
each node of the domain that has an experience table. Moreover, the inference
engine will be reset and use the new conditional probability.
If the contents of the experience tables are all zeros,
then the algorithm will compute the best ("maximum likelihood")
conditional probability tables, assuming that any table is valid (i.e. there are
no restrictions on the form of the tables). If the contents are not all zeros,
then the product of the experience table and the conditional probability tables
is used to form counts ("prior counts") that will be added to
those derived from the data set. This is known as "penalized EM".
The starting point or the EM algorithm is the conditional
probability tables specified prior to calling the algorithm, assuming that the
domain has been compiled with these tables. If no table has been specified, uniform
distributions are assumed. Sometimes it is desirable to enforce zeros in the
conditional probability tables for the configurations that should be impossible
(i.e. having zero probability).
The EM algorithm performs a number of iterations. For each iteration the logarithm of the probability of the case data given the current joint probability distribution is computed. This quantity is known as the log-likelihood, and the EM-algorithm attempts to maximize this quantity. The EM algorithm terminates when the relative difference between the log-likelihood for two successive iterations is sufficiently small. I.e. when the relative difference between the log-likelihood for two successive iterations becomes less than tolerance, which must be a positive number. By default the initial value of tolerance is 10-4.
In an influence diagram a link can mean one of three things:
A link can be established in edit mode by activating the link tool and dragging a line from one node to another.
![]() |
Figure 40: The link tool button from the edit mode tool bar. |
When the link tool is activated (when the link tool button is pressed) you can drag a link from one node to another in the network pane: Press the left mouse button somewhere within one node and drag the cursor into another node. Then, release the mouse button again. When you have created the link, the select tool is normally activated again. If you want to keep the link tool activated (to create a series of links) hold down the SHIFT key while creating the link.
![]() |
Figure 41: The lock evidence button from the run mode tool bar. |
The lock display of evidence function is meant to allow the user to view the likelihood he/she has entered in a node. Normally (when the lock display of evidence is disabled), the monitors and the node list pane will for all nodes show the belief of a node being in each of its states. When the lock display of evidence function is activated (when the lock display of evidence tool button is pressed) the monitors and node list pane will show the entered findings for all nodes having entered findings. This is most relevant for nodes having likelihood entered.
![]() |
Figure 42: The lock node edit pane button from the edit mode tool bar. |
The lock node edit pane function helps the user when the cpt or utility table of a node get too wide to be kept inside the node edit pane. If lock node edit pane is disabled, when you scroll to the right, the left most column showing parent names and state names of the currently selected node will disappear. When lock node edit pane is activated, the left most column is cut of and placed in the left side of the node edit pane - even when the user scrolls the left most columns of the cpt/utility table out of view.
Figure 43 shows the main window.
![]() |
Figure 43: The main window |
You can select to specify a table manually by selecting the Manual item of the Table menu.
![]() |
Figure 44: The red circle shows the mode indicator in the status bar of the main window. Here, it indicates edit mode. |
![]() |
Figure 45: The red circle shows the mode indicator in the status bar of the main window. Here, it indicates run mode. |
There are three types of monitor windows (see figure 46, figure 47, and figure 48) - one for each of the node types: discrete chance node, continuous chance node, and decision node. You cannot open a monitor window for a utility node.
![]() |
Figure 46: A monitor window for a discrete chance node |
![]() |
Figure 47: A monitor window for a continuous chance node |
![]() |
Figure 48: A monitor window for a decision node |
The monitor windows show (monitor) the calculated results for a node:
Monitor windows for continuous chance nodes can open with or without showing the graph display below the pane showing mean and variance (depending on the settings in Network Properties as described later). You can open and close it by clicking the small button on the right of the mean and variance. You can chose different end points as the mean plus/minus an integral multiple of the variance from the two drop down lists below the pane containing the graph.
On the right side of the graph there is a slider which can be used to zoom in on the x-axis to spot local peaks on the graph. Just below this slider is a button which should be pressed after each propagation to update the graph if auto update of graphs is not enabled. Hugin does not automatically update the graphs because this could take a very long time on large Bbns.
You can customize the monitor windows to your needs in the Monitors tab of the Network Properties dialog box. Figure 49 shows the Monitors tab.
![]() |
Figure 49: The Network Properties dialog box showing the Monitors tab. |
You can set the monitors to show at most a certain number of states in the Monitor States group box. For continuous chance nodes, you can specify if you always want the monitor to open with the graph pane and you can specify the end points (in multiples of the variance) of the graph.
You can also specify the graph precision. Normally, you would want the graph as precise as possible but if you have a large network with many continuous chance nodes and poor performance, you might save some time if you decrease graph precision.
The Network menu contains items covering different items for activities in a Hugin Bbn.
![]() |
Figure 50: The contents of the Network menu. |
Figure 51 shows the network pane containing a Bbn.
![]() |
Figure 51: The network pane. |
In the network properties dialog box are six tabs covering different parts of the tool:
![]() |
Figure 52: The network properties dialog box with the Description tab currently chosen. |
If you are editing or running a network (Bbn or influence diagram), you can view the network description fast by moving the mouse cursor into the network pane and pressing SHIFT + right mouse button.
The network windows can have two different looks depending on the mode you are currently working in. If you are constructing (editing) the Bbn, the network window is in edit mode. If you are using the Bbn for calculations, the network window is in run mode.
![]() |
Figure 53: The new button from the main window tool bar. |
The new function opens a new clean network window where you start constructing a new Hugin Bbn.
Figure 54 shows a node edit pane of a discrete chance node.
![]() |
Figure 54: The node edit pane. |
You should be aware of the different between the node label and the node name.
Figure 55 shows a node list pane of a Bbn.
![]() |
Figure 55: The node list pane. |
When you expand a node in the node list, you can see the calculated results of the last propagation in a format similar to monitor windows.
You should be aware of the different between the node name and the node label.
Figure 56 shows the node properties dialog box. It is organized in three tabs which are documented separately:
![]() |
Figure 56: The node properties dialog box showing the Node Tab. |
![]() |
Figure 203: The node properties dialog box showing the Node Tab. |
In the top of the Node tab you can specify the node name, node label, node type, and group of the selected node (name and label can only be specified in edit mode. Below these fields, you can also specify a description for the node. The node type can only be specified for discrete chance nodes and decison nodes.
![]() |
Figure 57: The open button from the main window tool bar. |
The open function in Hugin is like the open function in most other applications: It opens a saved Hugin network. It can open files of both hkb format (compiled Hugin network format) and net format (standard Bbn description format).
![]() |
Figure 58: The options menu from the main window. |
![]() |
Figure 59: The paste button from the main window tool bar. |
The paste function lets you insert what is currently stored on the clip board. In edit mode you can cut or copy a sub network in the network pane and afterwards paste it in the same network pane or in the network pane of another Hugin network (Bbn/influence diagram).
![]() |
Figure 60: The preferences dialog box with the General Options tab chosen |
In the General Options tab (figure 60) there are two groups of controls. In the first group (the General Options group), you can specify how many files you want to be shown in the recently used files list in the File menu. Below, you can specify if and how often you want to autosave. You can also specify different sound effects and if you want shadows behind the nodes in the network pane.
In the second group (the Drawing Pane group) you can specify how sensible you want the mouse to act in the edit mode network pane (the drawing pane).
![]() |
Figure 61: The preferences dialog box with the Belief Bar Colors tab chosen |
In the Belief Bar Colors tab (figure 61) you can change the default colors for belief, finding, inconsistency, likelihood, and locked findings used in the node list pane and the monitor windows.
Figure 62 shows the color select dialog window which appears when you click any of the buttons in the Belief Bar Colors tab.
![]() |
Figure 62: The color selection dialog box |
You can set the print options before printing using the page setup function.
![]() |
Figure 63: The print network button from the main window tool bar. |
The print network function prints the network graph of the currently active network window using a standard print dialog.
![]() |
Figure 64: The print node table button from the edit mode tool bar. |
The print node table function prints the node table (cpt or utility table) of the currently selected node using a standard print dialog.
![]() |
Figure 65: The print probabilities button from the run mode tool bar. |
The print probabilities function prints the results calculated for a series of nodes. When you activate the print probabilities function, a dialog box appears asking you to specify the nodes you want in the printed node series. This is followed by a standard print dialog.
![]() |
Figure 66: The four propagation buttons from the run mode tool bar. Propagation methods for these buttons are (from left to right): sum normal, max normal, sum fast retract, and max fast retract. |
The propagation function is used to make Hugin update all probabilities, distribution functions, and expected utilities of the discrete chance nodes, the continuous chance nodes, and the decision nodes, respectively.
There are four different propagation methods: Sum normal, max normal, sum fast retraction, and max fast retraction. The most commonly used method is the sum normal which updates all probabilities according to the entered evidence. The other methods have special purposes which you can read about in their description sections.
![]() |
Figure 67: The red circle shows the propagation indicator which is on (indicating auto propagation). It also shows that the chosen propagation method is sum normal. |
The prop max fast retract propagation method can be used in Bbns containing only discrete chance nodes. It is similar to the max normal method except that it shows the nodes which have recieved evidence differently. Instead of showing the values of the states of the node which has recieved evidence, the values of the states are shown as if this node had not recieved evidence. That is, the values of the node being in each of its states given the evidence entered in all other nodes. To indicate that the node has in fact recieved evidence, the belief bars use the color code for evidence (default: Red).
This propagation method can be used to check if the evidence corresponds to (one of) the most likely configuration(s) or if the evidence suggests that one of the less likely configurations has been observed (if a state of a node has been observed which does not have the value: 100).
![]() |
Figure 68: The prop max fast retract button from the run mode tool bar. |
The prop max normal propagation method can be used in Bbns containing only discrete chance nodes to find states belonging to the most probable configuration (a configuration is a list of states (a1, a2,..., an) of the list of all nodes in the Bbn (A1, A2,..., An)).
If a state of a node belongs to the most probable configuration it is given the value 100. All other states are given the relative value of the probability of the most probable configuration they are found in compared to the most probable configuration. That is, assume a node N has two states a and b, and b belongs to the most probable configuration of the entire Bbn which has the probability 0.002. Then, b is given the value 100. Now, assume that the most probable configuration which a belongs to has probability 0.0012. Then, a is given the value 60.
The prop max normal button which is found in the network window tool bar in run mode is shown in figure 69.
![]() |
Figure 69: The prop max normal button from the run mode tool bar. |
The prop sum fast retract propagation method can be used in Bbns containing only discrete chance nodes. It is similar to the sum normal method except that it shows the nodes which have recieved evidence differently. Instead of showing the true probability of the states of the node, the probability of the states are shown as if this node had not recieved evidence. That is, the probability of the node being in each of its states given the evidence entered in all other nodes. To indicate that the node has in fact recieved evidence, the belief bars use the color code for evidence (default: Red).
This propagation method can be used to check if the evidence entered in a node meets the probabilities of the evidence or if there are signs of some kind of conflict (the evidence entered is one of the most unlikely states of the node).
![]() |
Figure 70: The prop sum fast retract button from the run mode tool bar. |
The prop sum normal is the most commonly used propagation method. It updates all probabilities, distribution functions, and expected utilities of the discrete chance nodes, the continuous chance nodes, and the decision nodes, respectively, according to entered evidence.
The prop sum normal button which is found in the network window tool bar in run mode is shown in figure 71.
![]() |
Figure 71: The prop sum normal button from the run mode tool bar. |
This list of Hugin network files is a common Windows facility which enables the user to open a recently used network faster than using the standard open function. Selecting the menu item for one of the recently used files opens this network file in a new network window.
In the preferences dialog box, you can specify how long this list should be.
![]() |
Figure 72: The compile tool button from the run mode tool bar. |
You can use the recompile function to make a new compilation when a network has been saved with evidence and reloaded to get the initial beliefs (if a network was saved with evidence, the shown beliefs will be those calculated with this evidence.
See also Compile.
You retract a node when you have entered evidence into this node and want to eliminate this evidence from the node again.
![]() |
Figure 73: The network window of a HUGIN network running in run mode. |
You go from edit mode to run mode by clicking the compile button in the tool bar of the edit mode network window or by selecting the Compile item of the network menu. Figure 74 shows the compile button.
![]() |
Figure 74: The compile tool button from the network window tool bar. |
![]() |
Figure 75: The save button from the main window tool bar. |
When the save function is activated the user is able to save the currently active Hugin network in hkb format (compiled Hugin network format) through a standard Windows save dialog.
If you want to save your network in a new file you should use the save as function. You can also save it in net format (ASCII format which can be read in an editor). Then, you should use the save net file function.
The save as function is similar to the save function except that it always asks for a file name to save the network in (the save function just saves in the file the network was saved in earlier.
A net file is an ASCII file containing a network (Bbn/influence diagram) in a format compatible with the Bayesian Network Interchange Format (a standard format which all Bbn tools should use).
The select all function selects all nodes in the network pane. This allows you to do certain actions on all nodes at once in stead of doing it on one at a time.
The select state function is a special case (the most common case) of entrance of likelihood. What you actually do is entering the fact that one state now has probability 1 and all other states have probability 0.
![]() |
Figure 76: The select tool button from the edit mode tool bar. |
The select tool allows you to select one or more nodes in the network pane. You select a single node by clicking it or dragging a rectangle around it when the select tool is active. You can select a series of nodes by dragging a rectangle around the nodes you want selected. You can also add more nodes to the currently selected series of nodes by holding down the SHIFT key while selecting more nodes.
If you get an error in Hugin, you can use this function to view the error message and a description of the error in a small dialog box.
![]() |
Figure 77: The size bar in the top of the node list pane. |
Figure 205 shows the States tab. Here, you can specify the state names, state values, or state intervals depending on the type of the node you are currently editing.
You type in the state label/value/interval in the edit box below the states list and press "Rename
If you are editing an interval node, and you change a state interval, the neighboring states will automatically be fitted to your change so that there are no gaps between state intervals. You specify that an interval should represent all the values greater than a particular number by using "infinity" or "inf" as the end point of the interval. Eg: "10-inf". You can also use "-infinity" or "-inf".
If you are specifying an interval and you only type in one number, the system will use the end point of the previous state together with the number to form an interval. This can make interval specification faster.
![]() |
Figure 205: The node properties dialog box showing the States tab of a node having type "Numbered". |
![]() |
Figure 206: The node properties dialog box showing the States tab of a node having type "Numbered". |
Figure 204 shows the Table tab. In the top you find the Discrete Parents list. Here, you can define the order of the discrete parents as the appear in the table shown in the node edit pane.
For discrete chance nodes and utility nodes you can choose between editing the probability- or utility table either manually (you type in each and every number in the table) or you can specify expressions. This choise can be made in the select buttons below the Discrete Parents list.
![]() |
Figure 204: The node properties dialog box showing the Table tab. |
If you choose to edit expressions, you can select a number of Expression Table Nodes. These are discrete parents that you will probably node use in your expressions. In stead, you want to specify an expression for each configuration of these nodes - if you do not specify any expression table nodes, you need only specify one expression for the current node table.
![]() |
Figure 78: The tile windows horizontally tool button from the main window tool bar. |
The tile windows horizontally function arranges the network windows in the main window below each other.
![]() |
Figure 79: The tile windows vertically tool button from the main window tool bar. |
The tile windows vertically function arranges the network windows in the main window below each other.
![]() |
Figure 80: The tool bar setup dialog box which enables the user to customize the main window tool bar. |
You add an extra tool button to the main window tool bar by selecting it in the Available buttons list and pressing the Add button. You remove a button from the current tool bar by selecting it in the Toolbar buttons list and pressing the Remove button. By pressing Reset, you get back to the default tool bar setup.
![]() |
Figure 81: The update monitor graph button which can be found lower right corner of a monitor window showing the graph of a continuous chance node. |
You update the monitor graphs when you have propagated a Bbn containing continuous chance nodes with new evidence. You can specify Hugin to automatically update the graphs but in general (at least for large Bbns) you should disable automatical update because it can be very time consuming.
![]() |
Figure 82: The utility tool button from the edit mode tool bar. |
When the utility tool is activated (when the utility tool button is pressed) you can place a utility node in the network pane: Simply click the mouse somewhere within the network pane. When you have placed the utility node, the select tool is normally activated again. If you want keep the utility tool activated (to create a series of nodes) hold down the SHIFT key while placing a node.
Each utility function has assigned a utility table which specifies the utility of each configuration of the parents of the utility node (in an influence diagram, a link from a decision node or a discrete chance node represents the decision node/chance node to contribute directly to the utility function).
A utility node can be added to the current network (which will then be an influence diagram) by activating the utility tool and clicking somewhere in the network pane.
The utility table is the table of utilities found in the node edit pane when the node specified by the node name and node label (the currently selected node) is a utility node.
Only if you have chosen to specify the table manually (alternative to using expressions), you can see the utility table. Otherwise, you see the table of expressions specifying the utility table.
The utility table specifies a utility function. For each configuration of the states of the parents, the utility table has an entry specifying a utility value of this configuration. Figure 83 shows the utility table of a utility node with two parents (Active and Color).
![]() |
Figure 83: The utility table of a utility node with two parents (Active and Color). |
Each numeric value in the utility table is the utility of the parent nodes being in the states found in the top of the actual column.
You can change a specific numeric value by selecting it with the mouse cursor and typing in a new value from the keyboard.
![]() |
Figure 84: The View menu of the main window. |
![]() |
Figure 85: The Window menu of the main window. |
This function is useful on large networks to get a better view of the whole network.
![]() |
Figure 86: The Zoom sub items of the Network menu of the main window. |