Inference in dynamic Bayesian networks

<< Click to Display Table of Contents >>

Navigation:  Using GeNIe > Dynamic Bayesian networks >

Inference in dynamic Bayesian networks

Inference in a DBN, similarly to inference in a BN, amounts to calculating the impact of observation of some of its variables on the probability distribution over other variables. The additional complication is that both evidence and the posterior probability distributions are indexed by time. We will go through the example used in the previous sections to demonstrate setting evidence, running an algorithm, and viewing the results.

Setting temporal evidence

Suppose that during her week-long shift, the guard observes an umbrella on every day except for day three (day count starts with zero), when she was sure she did not see any umbrella and day four, when she forgot whether she saw an umbrella or not. This means that the evidence vector for the node Umbrella is as follows:

Umbrella[0:6]= [true, true, true, false, --, true, true].

To enter this evidence, we right-click on the Umbrella node and select Evidence...

temporal_plate_context_menu

This invokes the Dynamic Evidence dialog

dynamic_evidence_dialog

We enter the evidence vector as specified above:

dynamic_evidence_dialog1

Running the belief updating algorithm

Running the belief updating algorithm is identical to doing so in Bayesian networks. We press the Update (update_tool) button or select Update Beliefs from the Network Menu. GeNIe converts the DBN into a Bayesian network (this is called unrolling - see below) and updates the beliefs using the selected belief updating algorithm.

Viewing the results: Temporal posterior beliefs

After the network has been updated, we can view its temporal beliefs, which are marginal posterior probability distributions as a function of time. Hovering the mouse over the status icon yields the following views:

temporal_beliefs_raintemporal_beliefs_umbrella

Please note that the Umbrella node is an evidence node. Its temporal beliefs are also well defined, albeit for those time slots for which there are observations, they are constant.

We can view the temporal beliefs in the Value Tab of a node as a spreadsheet indexed by the time steps. Selecting cells in the results spreadsheet and pressing the Copy (copy_button) button copies the cells for use outside of GeNIe.

In addition to the numerical values of the marginal posterior probabilities over time, we can view the results graphically. Pressing the Area chart (area_chart_button) button displays the posterior marginal probabilities graphically:

value_tab_temporal_beliefs

Pressing the Time series (time_series_button) button shows the posteriors as a time series plot (a curve for every state of the variable):

value_tab_time_series_plot

Finally, pressing the Contour plot (contour_plot_button) button displays the posterior marginal beliefs as a contour plot with probabilities displayed by colors. Hovering over individual areas shows the numerical probabilities corresponding to the areas/colors. The Contour plot is especially useful when the variable has many states and shows graphically the weight of probability mass.

value_tab_contour_plot

There is one more plot available in case of discrete numerical variables, notably plot of  the mean of the variable as a function of time. To show that plot, please press the Mean button (mean_button).

value_tab_mean

The plot can be enhanced by displaying the standard deviation around the mean. We can accomplish this by pressing the Standard deviation button (sigma_button)

value_tab_sigma

The pictorial representation of the temporal probability distributions can be copied and later pasted into another application for the purpose of documentation or reporting. To copy the pictorial representation of the temporal probability distributions, right-click on it, select Copy, and subsequently choose Paste Special in the destination application.

One should add that the relative size of the table and the plot area can be in each of the above plots adjusted by clicking and dragging on the divider line.

Marginal posterior probabilities can be also shown on the screen permanently by the changing the node view to Bar chart. This can be accomplished by selecting nodes of interest and then changing the view of the nodes through the Node-View as-Bar Chart option.

node_view_as

The Bar chart view allows for displaying the temporal posterior marginal probabilities on the screen permanently.

temporal_plate_bar_charts

Unrolling the DBN

As we mentioned above, for the purpose of inference, GeNIe converts the DBN into a Bayesian network and updates the beliefs using the selected belief updating algorithm. It can be useful, for example for model debugging purposes, to explicitly unroll a temporal network. GeNIe provides this possibility through the Network-Dynamic Models-Unroll option.

network_menu_dynamic_models

GeNIe creates a new network that has the temporal network unrolled for the specified number of time-slices. The unrolled network that is a result from unrolling the temporal network is cleared from any temporal information whatsoever. It can be edited, saved and restored just like any other static network. The screen shot below shows the unrolled network representation of a temporal network and how the original DBN can located back from the unrolled network.

unrolled_dbn

It is possible to locate a node in the temporal network from the unrolled network by right-clicking on the node in the unrolled network and selecting Locate Original in DBN from the context-menu.

unrolled_dbn_locate

The node will be identified in the original DBN:

unrolled_dbn_located