Contenuto principale

Estimate Vector Error-Correction Model Using Econometric Modeler

This example models the annual Canadian inflation and interest rate series by using the Econometric Modeler app. The example shows how to perform the following actions in the app:

  1. Test each raw series for stationarity.

  2. Test for cointegration and determine a Johansen cointegration form if cointegration is present.

  3. Fit several completing vector error-correction (VEC) models, and choose the one with the best, parsimonious fit.

  4. Diagnose each residual series.

  5. Export the chosen model to the command line.

At the command line, the example uses the model to generate forecasts.

The data set, which is stored in Data_Canada, contains annual Canadian inflation and interest rates from 1954 through 1994.

Load and Import Data into Econometric Modeler

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

load Data_Canada

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.

The Canadian interest and inflation rate variables appear in the Time Series pane, and a time series plot of all the series appears in the Plot(INF_C) figure window.

Time series plot of all the series

Plot only the three interest rate series INT_L, INT_M, and INT_S together. In the Time Series pane, click INT_L and Ctrl+click INT_M and INT_S. Then, on the Plots tab, in the Plots section, click Time Series. The time series plot appears in the Plot(INT_L) document.

Time series plot of the interest rate series

The interest rate series each appear nonstationary, and they appear to move together with mean-reverting spread. In other words, they exhibit cointegration. To establish these properties, this example conducts statistical tests.

Conduct Stationarity Test

Assess whether each interest rate series is stationary by conducting Phillips-Perron unit root tests. For each series, assume a stationary AR(1) process with drift for the alternative hypothesis. You can confirm this property by viewing the autocorrelation and partial autocorrelation function plots.

Close all plots in the right pane, and perform the following procedure for each series INT_L, INT_M, and INT_S.

  1. In the Time Series pane, click a series.

  2. On the Modeler tab, in the Tests section, click Add Test > Phillips-Perron Test.

  3. On the PP tab, in the Settings section, in the Number of Lags box, type 1, and in the Model list select Autoregressive with Drift.

    Phillips-Perron test parameter settings

  4. In the Tests section, click Run Test. Test results for the selected series appear in the PP(series) tab.

Position the test results to view them simultaneously.

Phillips-Perron test results

All tests fail to reject the null hypothesis that the series contains a unit root process.

Conduct Cointegration Test

To create and estimate a VEC model of unit root series, the series need to exhibit cointegration. Conduct a Johansen test. Because the raw series do not contain a linear trend, assume that the only deterministic term in the model is an intercept in the cointegrating relation (H1* Johansen form), and include 1 lagged difference term in the model.

  1. In the Time Series pane, click INT_L and Ctrl+click INT_M and INT_S.

  2. In the Tests section, click Add Test > Johansen Test.

  3. On the JCI tab, in the Settings section, in the Number of Lags box, type 1. In the Model list, select H1*.

    Johansen test parameter settings

  4. In the Tests section, click Run Test. Test results and a plot of the cointegration relation for the largest rank appear in the JCI tab.

Johansen test results

Econometric Modeler conducts a separate test for each cointegration rank 0 through 2 (the number of series – 1). The test rejects the null hypothesis of no cointegration (Cointegration rank = 0), but fails to reject the null hypothesis of Cointegration rank ≤ 1. The conclusion is to set the cointegration rank of the VEC model to 1.

Estimate VEC Models

Estimate 3-D VEC(p) models of the interest rate series, with a cointegration rank of 1 and p = 1 and 2.

  1. With INT_L, INT_M, and INT_S selected in the Time Series pane, in the Models section, click VEC.

  2. In the VEC Model Parameters dialog box, in the Johansen Form, select H1*. Fit the VEC(1) model by clicking Estimate.

    VEC Model Parameters dialog set to fit a VEC(1) model

    The model variable VEC appears in the Models pane, its value appears in the Preview pane, and its estimation summary appears in the Fit(VEC) document. Change the name of the VEC model to VEC_1 by clicking VEC twice and then typing VEC_1.

  3. Repeat steps 1 and 2 for the short-run polynomial order p = 2.

    Similar to the VEC(1) estimation, the variable VEC_2 appears in the Models pane, and its estimation summary appears in the Fit(VEC_2) tab. You can view properties of an estimated model in the Preview pane by clicking the model in the Models pane. For example, click VEC.

    Object display of model VEC

Select Model with Best In-Sample Fit

The estimation summary in each Fit(VEC_p) tab contains a plot of fitted values and residuals, with respect to the time series in the Time Series list, a standard statistical table of estimates and inferences, and a table of information criteria.

Compare the information criteria of each estimated model simultaneously by positioning the estimation summary documents so that they occupy the left and right sections of the right pane. The model with the lowest value has the best, parsimonious fit.

All estimation summaries occupying the four quadrants of the right pane

The VEC(1) model VEC produces the lowest AIC and BIC values. Choose this model for further analysis.

Check Goodness of Fit

Inspect the following VEC(1) plots of each residual series:

  • Histograms, for center, normality, and outliers

  • Quantile-quantile plots, for normality, skewness, and tails

  • Autocorrelation function (ACF), for serial correlation

  • ACF of squared residual series, for heteroscedasticity

This example diagnoses the residuals visually. Alternatively, you can conduct statistical tests to diagnose the residuals.

Dismiss the Fit(VEC2) document by clicking x on its tab.

On the Models pane, click VEC_1.

Plot separate residual histograms. On the Modeler tab, in the Diagnostics section, click Model Fit Diagnostics > Residual Histogram. Histograms of the each residual series appear in the Hist(VEC_1) document.

Histograms of each residual series

Each residual series appears approximately centered around 0 and approximately normal.

Plot separate residual quantile-quantile plots. With VEC_1 selected in the Time Series pane, on the Modeler tab, in the Diagnostics section, click Model Fit Diagnostics > Residual Q-Q Plot. Quantile-quantile plots of each residual series appear in the QQ(VEC_1) document.

Quantile-quantile plots of each residual series

The residual series are slightly skewed left and have lighter tails than the normal distribution. This example proceeds without addressing possible skewness and light tails.

Plot separate ACF plots of each residual series. With VEC_1 selected in the Time Series pane, on the Modeler tab, in the Diagnostics section, click Model Fit Diagnostics > Residual Autocorrelation. ACF plots of each residual series appear in the ACF(VEC_1) document.

ACF plots of each residual series

The residuals do not exhibit significant autocorrelation.

Plot separate ACF plots of each squared residual series. With VEC_1 selected in the Time Series pane, on the Modeler tab, in the Diagnostics section, click Model Fit Diagnostics > Squared Residual Autocorrelation. ACF plots of each squared residual series appear in the ACF(VEC_1)_2 document.

ACF plots of each squared residual series

Each squared residual series has significant autocorrelations at early lags, which suggests that heteroscedasticity is present in all series. This example proceeds without addressing possible heteroscedasticity.

Generate Forecasts

Generate MMSE forecasts and approximate 95% forecast intervals from the estimated VEC(1) model for the next four years (16 quarters).

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

  2. In the Modeler tab, in the Forecast section, click Forecast.

  3. In the Forecast Model Response dialog box, set Number of periods in forecast horizon to 16. Then, click Forecast.

    This screenshot shows the Forecast Model Response dialog with the Number of periods in forecast horizon parameter set to16 and the Method set to Minimum Mean-Squared Error.

In the right pane, in the For(VEC_1) tab is a figure window of a plot of the INT_L series with forecasts and 95% forecast intervals at the end of the series, generated from the VEC(1) model.

INT_L forecasts generated from the VEC(1) model

To display the forecasts of the other variables in the VEC(1) model, use the Time Series menu in the figure window. For example, display the forecasts of the INT_S series, in the figure window, click Time Series > INT_S.

INT_S forecasts generated from the VEC(1) model

See Also

Apps

Objects

Functions

Topics