In this tutorial we will build a simple model from multivariate time series data.
The data consists of a single time series over the two continuous variables X1 and X2. A chart of X1 and X2 is shown below.
We will create the simple Dynamic Bayesian network shown below.
To add the temporal X node, click the Node drop down on the Network tab, Editing group, and select the Continuous (Temporal) menu item, to create a new node. This will launch the New node window.
Enter X in the Name text box.
This node will contain two continuous variables, so in the Variable section, click the Multiple tab.
Click the Add Continuous toolbar button twice, to add two new continuous variables to the node.
Note that we could have added the nodes automatically using the Add nodes from data feature.
To add the first temporal link, click the Link button on the Network tab, Editing group. This will launch the New link window.
Select X as the From node.
Also select X as the To node.
Ensure the Range checkbox is checked, which makes it easier to add multiple links in one step.
Enter the value 1 in the Minimum text box.
Enter the value 4 in the Maximum text box.
You can either evaluate a time series model on unseen data with different Temporal orders to determine the best model, or you can use Structural learning.
To understand the structure of a Dynamic Bayesian network, click the Unroll button on the Network tab, Refactoring group, to see what the equivalent Bayesian network would look like. Note that unrolling is not required to work with Dynamic Bayesian networks.
We could now enter the distribution parameters for the nodes manually using the Distribution editor, however in this tutorial we will learn the parameter values from data.
In the Data Connection drop down, select the new Data Connection created in an earlier step, or the Tutorial data connection if you skipped that step. This should enable the Time series / sequential Data drop down.
In the Time series / sequential Data drop down, select the worksheet that contains the data. (If the data is on the first worksheet, select Sheet1$). If you are using the pre-installed Tutorial data connection, select Tutorial 3 - Time series.
In the Data map window, ensure that the variables X1 and X2 have automatically been mapped to columns X1 and X2 respectively.
Select the Case data column in the Case Id Column drop down, if it has not already been automatically mapped.
Using a Case Id column in this example is optional as we only have a single multivariate time series.
Select the Time data column in the Time Column drop down, if it has not already been automatically mapped.
Click Next in the wizard, accepting all the default settings, until you reach the Options page.
Ensure the Time Series mode is set to Rolling.
Click Next in the wizard, until you reach the Run page. Click the Run button to start learning.
The network distributions have now been learned.
Before predicting future values, we will enter some evidence.
Ensure Data explorer is open by clicking the Data Explorer button on the View toolbar tab, Explorers group.
You can enter evidence manually using the Evidence window, however we will use Data Explorer here for convenience.
Click in Data Explorer to ensure it has focus.
A contextual tab should appear on the toolbar, with the title Data Explorer. If the tab's contents are not visible, click on the Data Explorer tab.
Click the Load button on the Data Explorer tab, Data group. This will launch the Data tables window.
In the Data Connection drop down, select the Data Connection created earlier. This should enable the Time Series / Sequential data drop down.
Click the OK button. This will load the data into Data explorer.
Data explorer should look like this.
Data Explorer loads data into memory, so should not be used for large data sets.
Select the only case in the top pane of Data Explorer with id 0, and click the Apply button in the Data Explorer tab, Apply group. This will set evidence on the network.
Instead of clicking the Apply button, you can double click the case in the top pane of Data Explorer to apply evidence.
To check that the evidence has been set correctly, and to see how you might enter evidence manually, click the Edit Evidence button in the Query tab, Evidence group. This will launch the Evidence window.
Double clicking a node, also opens the Evidence window.
Click the Discard changes button on the Evidence tab, Close group, to close the evidence window.
Click the All button with the green arrow at the bottom of network viewer, or use the shortcut F6 to query all the nodes in the network. This will launch the Series query window.
Relative means that times starts from the maximum evidence time.
You can change the display by clicking the Toggle Chart Display Type button on the Node toolbar shown below.
The network created in this tutorial can be extended by adding additional nodes, to model more complex data.
For example, discrete nodes could be added, that represent different regimes/contexts, allowing the Gaussian distributions to vary. This could be a node that is mapped to data, or a latent (cluster) variable, similar to that used in Tutorial 2 - Mixture model however is typically a temporal node.