Using the Table Generator

(Tutorial)

This tutorial shows you how the table generator functionality can be used to simplify how tables are specified for discrete chance nodes.

Imagine you are playing a game of dice where you roll a number of dice ranging from 1 to 5. The more sixes you roll the better, so you are very interested in predicting how many sixes you can expect to roll.

A very simple Bayesian network can model your situation. Figure 1 shows a Bayesian network where the number of dice rolled (nDice) have an impact on the number of sixes rolled (nSixes).

Figure 1: Bbn modelling the dice problem.

nDice has states: 1, 2, 3, 4, 5 (the number of dice you could be asked to roll). nSixes has states: 0, 1, 2, 3, 4, 5 (one more than nDice since it is possible not to roll any sixes).

Now, because we want the states of the nodes to represent numiric values, we change their type to "Numbered". Here is shown how to change nDice to a numbered node:

Now, change nSixes to be numbered too!

You can edit the number of states and the state values in the left most column of the node edit pane (as you probably did in the first tutorial). However, you can also do it through the Node Properties dialog:

Now, do the same for nSixes (remember to start with state "0").

Figure 2 shows the Node Properties dialog after having entered the state values of nDice.

Figure 2: Entering the state values of nDice.

The conditional probability table of nSixes in the node edit pane should now look as the one shown in figure 3.

Figure 3: The conditional probability table of nSixes.

This table is rather big and if you should fill it in yourself it would be a pretty hard task. You would also have have a tool for calculating the Binomial distribution, since the probability of rolling a specific number of is a Binomial distribution depending on the number of dice you roll.

However, Hugin allows you to generate the table automatically from an expression you specify. To do this for the nSixes node follow these steps:

Now, you should have the expression "Binomial (nDice, 1/6)" in the single field of the nSixes table. This is shown in figure 4.

Figure 4: The expression table of nSixes after having specified a Binomial distribution depending on nDice.

This ends the tutorial of building a small Baysian network using the table generator. Try compiling it and play with it (try selecting different values for the nDice node and propagate. After having compiled the network, you can also go back to edit mode and take a look at the generated table: Select the nSixes node and from the "Table" menu select "Manual". You will be warned that you are destroying the expression, but that does not matter now. You can rebuild them if you want.


HUGIN Expert A/S , 1998

Back