Main Content

Estimate Regression Model with ARMA Errors Using Econometric Modeler App

This example shows how to specify and estimate a regression model with ARMA errors using the Econometric Modeler app. The data set, which is stored in Data_USEconModel.mat, contains the US personal consumption expenditures measured quarterly, among other series.

Consider modeling the US personal consumption expenditures (PCEC, in $ billions) as a linear function of the effective federal funds rate (FEDFUNDS), unemployment rate (UNRATE), and real gross domestic product (GDP, in $ billions with respect to the year 2000).

Import Data into Econometric Modeler

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

load Data_USEconModel

Convert the federal funds and unemployment rates from percents to decimals.

DataTimeTable.UNRATE = 0.01*DataTimeTable.UNRATE;
DataTimeTable.FEDFUNDS = 0.01*DataTimeTable.FEDFUNDS;

Convert the nominal GDP to real GDP by dividing all values by the GDP deflator (GDPDEF) and scaling the result by 100. Create a column in DataTimeTable for the real GDP series.

DataTimeTable.RealGDP = 100*DataTimeTable.GDP./DataTimeTable.GDPDEF;

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 Econometric Modeler tab, in the Import section, click the Import button .

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

  3. Click Import.

All time series variables in DataTimeTable appear in the Time Series pane, and a time series plot of the series appears in the Time Series Plot(COE) figure window.

Plot the Series

Plot the PCEC, RealGDP, FEDFUNDS, and UNRATE series on separate plots.

  1. In the Time Series pane, double-click PCEC.

  2. Repeat step 1 for RealGDP, FEDFUNDS, and UNRATE.

  3. In the right pane, drag the Time Series Plot(PCEC) figure window to the top so that it occupies the first two quadrants.

  4. Drag the Time Series Plot(RealGDP) figure window to the first quadrant.

  5. Drag the Time Series Plot(UNRATE) figure window to the third quadrant.

Separate time series plots of PCEC, RealGDP, UNRATE, and FEDFUNDS

The PCEC and RealGDP series appear to have an exponential trend. The UNRATE and FEDFUNDS series appear to have a stochastic trend.

Right-click the tab for any figure window, then select Close All to close all the figure windows.

Assess Collinearity Among Series

Check whether the series are collinear by performing Belsley collinearity diagnostics.

  1. In the Time Series pane, select PCEC. Then, press Ctrland click to select RealGDP, FEDFUNDS, and UNRATE.

  2. On the Econometric Modeler tab, in the Tests section, click New Test > Belsley Collinearity Diagnostics.

The Belsley collinearity diagnostics results appear in the Collinearity(FEDFUNDS) document.

Screen shot shows the Collinearity function with Condition Index set at 30, Variance-Decomposition Proportion set at 0.5, and the Time Series PCEC, RealGDP, and UNRATE selected. The Belsley Collinearity Diagnostics table is in the Collinearity(FEDFUNDS) tab.

All condition indices are below the default condition-index tolerance, which is 30. The time series do not appear to be collinear.

Specify and Estimate Linear Model

Specify a linear model in which PCEC is the response and RealGDP, FEDFUNDS, and UNRATE are predictors.

  1. In the Time Series pane, select PCEC.

  2. Click the Econometric Modeler tab. Then, in the Models section, click the arrow to display the models gallery.

  3. In the models gallery, in the Regression Models section, click MLR.

  4. In the MLR Model Parameters dialog box, in the Predictors section, select the Include? check box for the FEDFUNDS, RealGDP, and UNRATE time series.

    Multiple linear regression predictor selection dialog box with FEDFUNDS, RealGDP, and UNRATE selected. "Details". "Estimate", and "Cancel" buttons are at the bottom right corner of the dialog box.

  5. Click Estimate.

The model variable MLR_PCEC appears in the Models pane, its value appears in the Preview pane, and its estimation summary appears in the Model Summary(MLR_PCEC) document.

This screen shot shows time series plots of Model Fit for PCEC and MLR_PCEC and Residual Plot for the variable MLR_PCEC on the left and two tables for Parameters and Goodness of Fit to the right.

In the Model Summary(MLR_PCEC) figure window, the residual plot suggests that the standard linear model assumption of uncorrelated errors is violated. The residuals appear autocorrelated, nonstationary, and possibly heteroscedastic.

Stabilize Variables

To stabilize the residuals, stabilize the response and predictor series by converting the PCEC and RealGDP prices to returns, and by applying the first difference to FEDFUNDS and UNRATE.

Convert PCEC and RealGDP prices to returns:

  1. In the Time Series pane, select the PCEC time series, then press Ctrl and select the RealGDP time series.

  2. On the Econometric Modeler tab, in the Transforms section, click Log, then click Diff.

    In the Time Series pane, variables representing the logged and differenced time series appear.

  3. In the Time Series pane, rename the PCECLogDiff and RealGDPLogDiff. Click the PCECLogDiff variable twice to select its name and enter PCECReturns. Click the RealGDPLogDiff variable twice to select its name and enter RealGDPReturns.

Apply the first difference to FEDFUNDS and UNRATE:

  1. In the Time Series pane, select the FEDFUNDS time series, then press Ctrl and select the UNRATE time series.

  2. On the Econometric Modeler tab, in the Transforms section, click Difference.

    In the Time Series pane, variables representing the first difference of the time series appear.

  3. Close all figure windows and documents.

Respecify and Estimate Linear Model

Respecify the linear model, but use the stabilized series instead.

  1. In the Time Series pane, select PCECReturns.

  2. On the Econometric Modeler tab, in the Models section, click the arrow to display the models gallery.

  3. In the models gallery, in the Regression Models section, click MLR.

  4. In the MLR Model Parameters dialog box, in the Predictors section, select the Include? check box for the FEDFUNDSDiff, RealGDPReturns, and UNRATEDiff time series.

  5. Click Estimate.

The model variable MLR_PCECReturns appears in the Models pane, its value appears in the Preview pane, and its estimation summary appears in the Model Summary(MLR_PCECReturns) document.

This screen shot shows time series plots of Model Fit for PCECReturns and MLR_PCECReturns and Residual Plot for the variable MLR_PCECReturns on the left and two tables for Parameters and Goodness of Fit to the right.

The residual plot suggests that the residuals are autocorrelated.

Check Goodness of Fit of Linear Model

Assess whether the residuals are normally distributed and autocorrelated by generating quantile-quantile and ACF plots.

Create a quantile-quantile plot of the MLR_PCECReturns model residuals:

  1. In the Time Series pane, select the MLR_PCECReturns model.

  2. On the Econometric Modeler tab, in the Diagnostics section, click Residual Diagnostics > Residual Q-Q Plot.

Residual Quantile-Quantile Plot showing MLR_PCECReturns with the y axis tracking Quantities of Input Sample and the x axis displaying Standard Normal Quantities.

The residuals are skewed to the right.

Plot the ACF of the residuals:

  1. In the Time Series pane, select the MLR_PCECReturns model.

  2. On the Econometric Modeler tab, in the Diagnostics section, click Residual Diagnostics > Autocorrelation Function.

  3. On the ACF tab, set Number of Lags to 40.

A time series plot of the Sample Autocorrelation Function for MLR_PCECReturns with Sample Autocorrelation shown on the y axis and Lag represented on the x axis. Confidence bounds are represented by blue horizontal lines.

The plot shows autocorrelation in the first 34 lags.

Specify and Estimate Regression Model with ARMA Errors

Attempt to remedy the autocorrelation in the residuals by specifying a regression model with ARMA(1,1) errors for PCECReturns.

  1. In the Time Series pane, select PCECReturns.

  2. Click the Econometric Modeler tab. Then, in the Models section, click the arrow to display the models gallery.

  3. In the models gallery, in the Regression Models section, click RegARMA.

  4. In the regARMA Model Parameters dialog box:

    1. In the Lag Order tab:

      1. Set Autoregressive Order to 1.

      2. Set Moving Average Order to 1.

    2. In the Predictors section, select the Include? check box for the FEDFUNDSDiff, RealGDPReturns, and UNRATEDiff time series.

      Screen shot of the regARMA Model Parameters dialog box showing parameter settings. "Details". "Estimate", and "Cancel" buttons are at the bottom right corner of the dialog box.

    3. Click Estimate.

The model variable RegARMA_PCECReturns appears in the Models pane, its value appears in the Preview pane, and its estimation summary appears in the Model Summary(RegARMA_PCECReturns) document.

This screen shot shows time series plots of Model Fit for PCECReturns and RegARMA_PCECReturns and Residual Plot for the variable RegARMA_PCECReturns on the left and two tables for Parameters and Goodness of Fit to the right.

The t statistics suggest that all coefficients are significant, except for the coefficient of UNRATEDiff. The residuals appear to fluctuate around y = 0 without autocorrelation.

Check Goodness of Fit of ARMA Error Model

Assess whether the residuals of the RegARMA_PCECReturns model are normally distributed and autocorrelated by generating quantile-quantile and ACF plots.

Create a quantile-quantile plot of the RegARMA_PCECReturns model residuals:

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

  2. On the Econometric Modeler tab, in the Diagnostics section, click Residual Diagnostics > Residual Q-Q Plot.

Residual Quantile-Quantile Plot showing the variable RegARMA_PCECReturns with the y axis tracking Quantities of Input Sample and the x axis displaying Standard Normal Quantities.

The residuals appear approximately normally distributed.

Plot the ACF of the residuals:

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

  2. On the Econometric Modeler tab, in the Diagnostics section, click Residual Diagnostics > Autocorrelation Function.

A time series plot of the Sample Autocorrelation Function for RegARMA_PCECReturns with Sample Autocorrelation shown on the y axis and Lag represented on the x axis. Confidence bounds are represented by blue horizontal lines.

The first autocorrelation lag is significant.

From here, you can estimate multiple models that differ by the number of autoregressive and moving average polynomial orders in the ARMA error model. Then, choose the model with the lowest fit statistic. Or, you can check the predictive performance of the models by comparing forecasts to out-of-sample data.

See Also

Apps

Objects

Functions

Related Topics