主要内容

Simulate Multivariate Model Responses Using Econometric Modeler App

In-sample model simulations visually demonstrate how well a model fits to a time series, particularly for stationary models, and they demonstrate the model's dynamics. This example shows how to estimate a VAR model and simulate random paths from the model by using the Econometric Modeler app. This example follows from the analysis in Compare Predictive Performance After Creating Models Using Econometric Modeler.

Although the example uses a VAR model, the workflow is similar for all multivariate models available in Econometric Modeler, such as VEC models.

The data set, which is stored in Data_USEconModel.mat, contains the raw, quarterly US GDP, M1 money supply, and 3-month T-bill rate, among other series, from 1947 through 2009.

Load and Import Data into Econometric Modeler

At the command line, load the Data_USEconModel.mat data set.

load Data_USEconModel

At the command line, open the Econometric Modeler app.

econometricModeler

Alternatively, open the app from the apps gallery (see Econometric Modeler).

Import DataTimeTable into the app:

  1. On the Modeler tab, in the Import section, click the Import button .

  2. In the Import Data dialog box, select the check box for the DataTimeTable variable.

  3. Click Import.

GDP, M1SL, and TB3MS, among other series, appear in the Time Series pane, and a time series plot containing all series appears in the figure window.

Transform Series

Remove the exponential trend from the GDP and M1 money supply series by applying the log transform to each series. Click the Modeler tab, and then, in the Time Series pane, click GDP and Ctrl click M1SL. In the Transforms section, click Log. The transformed series GDP_Log and M1SL_Log appear in the Time Series pane, and their time series plot appears in the Plot(GDP_Log) figure window.

Stabilize the series by applying the first difference to each series.

  1. Click the Modeler tab, and then, in the Time Series pane, click GDP_Log and Ctrl+click M1SL_Log and TB3MS.

  2. In the Transforms section, click Difference. The transformed series GDP_Log_Diff, M1SL_Log_Diff, and TB3MS_Diff appear in the Time Series pane, and their time series plot appears in the Plot(GDP_Log_Diff) figure window.

  3. Rename GDP_Log_Diff and M1SL_Log_Diff to GDPRate and M1SLRate by clicking their names twice in the Time Series pane, and typing their new names.

Estimate VAR Models

Fit a 3-D VAR(2) model to the US quarterly GDP growth rate series GDPRate, M1 money supply growth rate series M1SLRate, and change in the 3-month treasury bill rate series TB3MS_Diff.

  1. In the Time Series pane, click GDPRate and Ctrl+click M1SLRate and TB3MS_Diff.

  2. In the Models section, click VAR.

  3. In the VAR Model Parameters dialog box, set Autoregressive Order (p) to 2. Then, click Estimate.

    The model variable VAR appears in the Models pane, its value appears in the Preview pane, and its estimation summary appears in the Fit(VAR) document.

Simulate Estimated Model

Determine how well the estimated model describes the data by simulating 25 random paths from it.

  1. In the Models pane, select the VAR model.

  2. On the Modeler tab, in the Simulate section, click Simulate.

  3. In the Simulate Model Response dialog box, set Number of simulated paths to 25. Click Simulate.

    This screen shot shows the Simulate Model Response dialog box with Number of simulated paths set to 25.

In the Simulations pane, a variable SIM_VAR appears. This variable is a structure array with the following fields:

  • SimulationsT-by-m-k array of simulated paths, with rows corresponding to in-sample times, columns corresponding to the variables in the model, and pages corresponding to the independently drawn paths

  • MeanT-by-m matrix of the pointwise average of the simulated paths for each variable

  • UpperConfidenceBoundT-by-m matrix of upper confidence bounds of the pointwise 95% percentile-based confidence intervals for each path

  • LowerConfidenceBoundT-by-m matrix of lower confidence bounds of the pointwise 95% percentile-based confidence intervals for each path

In the right pane, in the Sim(VAR) tab, is a plot containing the following time series associated with the GDPRate variable:

  • The time series data (thick blue line)

  • Each simulated path (thin gray lines)

  • The pointwise average of the simulated paths (thick orange line)

  • The pointwise 95% percentile-based confidence intervals (thick orange dashed line)

This time series plot shows the GDP Rate time series with simulated paths and simulation statistics.

All simulated paths start at period two unless they require a longer presample to initialize the model, which is a common requirement for dynamic models. If a model requires a presample of more than 1 observation, all simulated paths begin at the time point after the end of the presample period. The length of the presample period depends on the dynamic model, see the associated reference page for details. A VAR(2) model requires two presample observations; therefore, all simulated paths start at the third time period in the in-sample data. Because M1SLRate observations begin at around 1960, the simulated paths begin just after then.

Several GDP rates are more extreme than expected, and most rates before 1980 are above the mean, while most rates after 1990 are below the mean. These characteristics might suggest that the model does not capture the true data-generating process well enough.

Plot the TB3MS_Diff simulated paths and statistics. In the right pane, in the Sim(VAR) window, click Time Series > TB3MS_Diff.

This time series plot shows the change in treasury bill time series with simulated paths and simulation statistics.

The change in the 3-month treasury bill shows unmodeled volatility in the early 1980s; the rest of the series is as expected give the model.

See Also

Apps

Objects

Functions

Topics