Dynamic Bayesian Networks: Creating DBN
From DSL
Consider a situation where you are a security guard at some secret underground installation. You have a shift of seven days and you want to know whether it is raining on the day of your return to the outside world. Your only access to the outside world occurs each morning when you see the director coming in, with or without, an umbrella. Furthermore, you know that the government has two secret underground installations: one in Pittsburgh and one in the Sahara, but you do not know which one you are guarding. For each day t, the set of evidence contains a single variable Umbrellat (observed an umbrella) and the set of unobservable variables contains Rain_t (whether it is raining) and Area (Pittsburgh or Sahara). If it is raining today depends on if it rained the day before and the geographical location. The figure below shows the required DBN.
Creating the DBN involves 4 Steps:
1. Creating the Bayesian Network
2. Activating the temporal pane
3. Adding temporal arcs
4. Setting the temporal probabilities
Step 1: Creating the Bayesian Network:
To create the DBN we first create a static BN containing three nodes: Area, Rain, and Umbrella and two arcs going from Area to Rain and from Rain to Umbrella, just as we would do normally. The result of this first step and their CPT's are shown in figure below:
Step 2: Activating Temporal Plate:
Since we are dealing with a temporal network, we need to add a temporal arc from Raint to Raint-1. Temporal arcs can only be added to nodes in the temporal plate.
The temporal plate is the part of the temporal network that contains the temporal nodes, which are Rain and Umbrella in this example. Before we can add nodes to the plate, we need to activate it first. This can be done by clicking on Network -> Enable Temporal Plate in the menu bar. This results in the network area being divided into three parts:
1. Initial conditions: this is the part of the network area where the anchor nodes are stored.
2. Temporal plate: this is the part of the network area where the nodes in the plate are stored. Nodes in the plate are the only nodes that are allowed to have temporal arcs. This area also shows the number of time-slices for which inference is performed.
3. Terminal conditions: this is the part of the network area where the terminal nodes are stored.
4. Contemporals: this is the part of the network area outside the temporal plate where static nodes are stored by default.
The temporal plate can be dragged and placed anywhere in the workspace. The boundaries of the different areas can be changed by dragging them as well. These boundaries are also used to layout the network when it is unrolled explicitly. Temporal types of nodes can be changed by dragging them to one of the three other areas. After enabling the temporal plate, we drag first the Umbrella node and second the Rain node (in this order!) to the temporal plate. This results in the network shown in figure below:
Please note, dragging the Rain node into the plate first would delete the link (arc) between Rain and Umbrella nodes. In which case, the user may need to drag the umbrella node into the temporal plate and add a link consciously between these nodes. However if you drag both the Umbrella and Rain nodes into the temporal plate, no links will be deleted.
Another option is, the user may create the network in the temporal plate directly.
Step 3: Adding the temporal arc
We now have a network with one contemporal node and two temporal nodes. The temporal arc can be added by clicking on the arc button and drawing an arc from the parent (Raint-1) to the child (Raint). When the mouse button is released, a context menu appears to enable us to set the temporal order of the arc. We create a temporal arc with order 1 as shown in the figure (a) below since our decision depends on if it rained the previous day or not. On the selection of the order a temporal arc will be created between the (Raint-1 and Raint)nodes as shown in figure (b) below.
Step 4: Setting the temporal probabilities
The next step is to add the static and temporal probabilities for thew above network. To set the static probabilities double click the node, select the Definition Tab and set the probabilities as done in the Tutorial 3. Setting the temporal probabilities is slightly different. In a temporal network, every node in the plate needs a CPT for every incoming temporal arc with a different temporal order. Just like setting the CPT for static nodes, the CPTs for temporal nodes can be set by double-clicking on the node in the network area and clicking the definition tab. When a node has incoming temporal arcs, the appropriate temporal CPT can be selected from a list and the CPT parameters can be set. Figures below demonstrates the process of adding the temporal probabilities.
Initially you want to define the probabilities when temporal order t=0 as shown in the figure above. The second step is to add the probabilities when temporal order t=1, which is done by selecting t=1 from the list as shown in the figure. As a result the below window will be shown to the user to set the temporal parameters for the node rain.
Now our first temporal network is finished! We can save it to a file and load it again as many times as we want, but more interesting is to see how we can reason with this network.
