GARCH Toolbox    

Incorporating a Regression Model in an Estimation

This section uses the asymptotic equivalence of auto-regressive models and linear regression models to illustrate the use of a regression component in the GARCH Toolbox. The example is presented in two parts:

Fitting an AR/GARCH Model to a Simulated Return Series

This section defines a specification structure for an AR/GARCH model, and then uses that model to fit a simulated return series to the defined model.

Define the AR/GARCH Model.   Start by creating a specification structure for an AR(2)/GARCH(1,1) composite model with successive calls to garchset. Set the Display flag to off to suppress the optimization details that garchfit normally prints to the screen.

Notice that in this specification structure, spec:

Fit the Model to a Simulated Return Series.   Simulate 2000 observations of the innovations, conditional standard deviations, and returns for the AR(2)/GARCH(1,1) process defined in spec. Use the model defined in spec to estimate the parameters of the simulated return series and then compare the parameter estimates to the original coefficients in spec.

The estimated parameters, shown in the Value column, are quite close to the original coefficients in spec.

Because you specified no explanatory regression matrix as input to garchsim and garchfit, these functions ignore the regression coefficients (Regress). Display the Comment field of the resulting garchfit output structure. It shows a 0 for the order of the regression component.

Fitting a Regression Model to the Same Return Series

To illustrate the use of a regression matrix, fit the return series y, an AR(2) process in the mean, to a regression model with two explanatory variables. The regression matrix consists of the first- and second-order lags of the simulated return series y.

Remove AR Component.   First, remove the AR component from the specification structure.

Create the Regression Matrix.   Create a regression matrix of first- and second-order lags using the simulated returns vector y as input. Examine the first 10 rows of y and the corresponding rows of the lags.

A NaN (an IEEE arithmetic standard for Not-a-Number) in the resulting matrix X indicates the presence of a missing observation. If you use X to fit a regression model to y, garchfit produces an error.

The error occurs because there are fewer valid rows (i.e., those rows without a NaN) in the regression matrix X than there are observations in y. The returns vector y has 2000 observations but the most recent number of valid observations in X is only 1998.

You can do one of two things to enable you to proceed. For a return series of this size it makes little difference which option you choose:

This example continues by replacing all NaNs with the sample mean of y. Use the MATLAB function isnan to identify NaNs and the function mean to compute the mean of y.

Fit the Regression Model.   Now that the explanatory regression matrix X is compatible with the return series vector y, use garchfit to estimate the model coefficients for the return series using the regression matrix and display the results.

These estimation results are similar to those shown for the AR model in the section Fitting an AR/GARCH Model to a Simulated Return Series. This similarity illustrates the asymptotic equivalence of auto-regressive models and linear regression models.

By illustrating the extra steps involved in formatting the explanatory matrix, this part of the example also highlights the additional complexity involved in modeling conditional means with regression components.


  Conditional Mean Models with Regression Components Simulation and Inference Using a Regression Component