## Perform GARCH Model Residual Diagnostics Using Econometric Modeler App

This example shows how to evaluate GARCH model assumptions by
performing residual diagnostics using the Econometric Modeler app. The data set,
stored in `CAPMuniverse.mat`

available with the Financial Toolbox™ documentation, contains market data for daily returns of stocks and
cash (money market) from the period January 1, 2000 to November 7, 2005. Consider
modeling the market index returns (`MARKET`

).

### Import Data into Econometric Modeler

At the command line, load the `CAPMuniverse.mat`

data
set.

`load CAPMuniverse`

The series are in the timetable `AssetsTimeTable`

.

At the command line, open the Econometric Modeler app.

econometricModeler

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

Import `AssetsTimeTable`

into the app:

On the

**Econometric Modeler**tab, in the**Import**section, click .In the Import Data dialog box, in the

**Import?**column, select the check box for the`AssetsTimeTable`

variable.Click

**Import**.

The market index variables, including `MARKET`

,
appear in the **Time Series** pane, and a time series plot
containing all the series appears in the **Time Series
Plot(APPL)** figure window.

### Plot the Series

Plot the market index series by double-clicking the
`MARKET`

time series in the **Time
Series** pane.

The series appears to fluctuate around *y* = 0 and exhibits
volatility clustering. Consider a GARCH(1,1) model without a mean offset for the
series.

### Specify and Estimate GARCH Model

Specify a GARCH(1,1) model without a mean offset.

In the

**Time Series**pane, select`MARKET`

.On the

**Econometric Modeler**tab, in the**Models**section, click the arrow to display the models gallery.In the models gallery, in the

**GARCH Models**section, click**GARCH**.In the GARCH Model Parameters dialog box, on the

**Lag Order**tab:Set

**GARCH Degree**to`1`

.Set

**ARCH Degree**to`1`

.

Click

**Estimate**.

The model variable `GARCH_MARKET`

appears in the
**Models** pane, its value appears in the
**Preview** pane, and its estimation summary appears in the
**Model Summary(GARCH_MARKET)** document.

The *p* values of the coefficient estimates are close to
zero, which indicates that the estimates are significant. The inferred
conditional variances show high volatility through 2003, then small volatility
through 2005. The standardized residuals appear to fluctuate around
*y* = 0, and there are several large (in magnitude)
residuals.

### Check Goodness of Fit

Assess whether the standardized residuals are normally distributed and uncorrelated. Then, assess whether the residual series has lingering conditional heteroscedasticity.

Assess whether the standardized residuals are normally distributed by plotting their histogram and a quantile-quantile plot:

In the

**Models**pane, select`GARCH_MARKET`

.On the

**Econometric Modeler**tab, in the**Diagnostics**section, click**Residual Diagnostics**>**Residual Histogram**.In the

**Diagnostics**section, click**Residual Diagnostics**>**Residual Q-Q Plot**.

The histogram and quantile-quantile plot appear in the
**Histogram(GARCH_MARKET)** and
**QQPlot(GARCH_MARKET)** figure windows,
respectively.

Assess whether the standardized residuals are autocorrelated by plotting their autocorrelation function (ACF).

In the

**Models**pane, select`GARCH_MARKET`

.On the

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

The ACF plot appears in the **ACF(GARCH_MARKET)** figure
window.

Assess whether the residual series has lingering conditional heteroscedasticity by plotting the ACF of the squared standardized residuals:

In the

**Models**pane, select`GARCH_MARKET`

.Click the

**Econometric Modeler**tab. Then, in the**Diagnostics**section, click**Residual Diagnostics**>**Squared Residual Autocorrelation**.

The ACF of the squared standardized residuals appears in the
**ACF(GARCH_MARKET)2** figure window.

Arrange the histogram, quantile-quantile plot, ACF, and the ACF of the squared
standardized residual series so that they occupy the four quadrants of the right
pane. On the **Documents** pane, click the **Document
Actions** button , select **Tile All**,
place the pointer in the (2,2) position of the matrix of squares.

Although the results show a few large standardized residuals, they appear to be approximately normally distributed. The ACF plots of the standardized and squared standardized residuals do not contain any significant autocorrelations. Therefore, it is reasonable to conclude that the standardized residuals are uncorrelated and homoscedastic.