Main Content

Select ARCH Lags for GARCH Model Using Econometric Modeler App

This example shows how to select the appropriate number of ARCH and GARCH lags for a GARCH model by using the Econometric Modeler app. The data set, stored in Data_MarkPound, contains daily Deutschmark/British pound bilateral spot exchange rates from 1984 through 1991.

Import Data into Econometric Modeler

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

load Data_MarkPound

At the command line, open the Econometric Modeler app.

econometricModeler

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

Import Data to the app:

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

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

  3. Click Import.

The variable Data1 appears in the Time Series pane, and its time series plot appears in the Time Series Plot(Data1) figure window.

This time series plot shows the exchange rate via the path of the variable Data1.

The exchange rate looks nonstationary (it does not appear to fluctuate around a fixed level).

Transform Data

Convert the exchange rates to returns.

  1. With Data1 selected in the Time Series pane, on the Econometric Modeler tab, in the Transforms section, click Log.

    In the Time Series pane, a variable representing the logged exchange rates (Data1Log) appears , and its time series plot appears in the Time Series Plot(Data1Log) figure window.

  2. In the Time Series pane, select Data1Log.

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

In the Time Series pane, a variable representing the returns (Data1LogDiff) appears. A time series plot of the differenced series appears in the Time Series Plot(Data1LogDiff) figure window.

Check for Autocorrelation

In the Time Series pane, rename the Data1LogDiff variable by clicking it twice to select its name and entering Returns.

The app updates the names of all documents associated with the returns.

This time series plot shows the path of the variable Returns.

The returns series fluctuates around a common level, but exhibits volatility clustering. Large changes in the returns tend to cluster together, and small changes tend to cluster together. That is, the series exhibits conditional heteroscedasticity.

Visually assess whether the returns have serial correlation by plotting the sample ACF and PACF:

  1. Close all figure windows in the right pane.

  2. In the Time Series pane, select the Returns time series.

  3. Click the Plots tab, then click ACF.

  4. Click the Plots tab, then click PACF.

  5. Drag the PACF(Returns) figure window below the ACF(Returns) figure window so that you can view them simultaneously.

This set of time series plots compare the differences between the Sample Autocorrelation Function of the variable Returns in the ACF tab and the Sample Partial Autocorrelation Function of the variable Returns in the PACF tab. Lag is shown on the x axis and blue horizontal lines indicate Confidence Bounds.

The sample ACF and PACF show virtually no significant autocorrelation.

Conduct the Ljung-Box Q-test to assess whether there is significant serial correlation in the returns for at most 5, 10, and 15 lags. To maintain a false-discovery rate of approximately 0.05, specify a significance level of 0.05/3 = 0.0167 for each test.

  1. Close the ACF(Returns) and PACF(Returns) figure windows.

  2. With Returns selected in the Time Series pane, on the Econometric Modeler tab, in the Tests section, click New Test > Ljung-Box Q-Test.

  3. On the LBQ tab, in the Parameters section, set Number of Lags to 5.

  4. Set Significance Level to 0.0167.

  5. In the Tests section, click Run Test.

  6. Repeat steps 3 through 5 twice, with these changes.

    1. Set Number of Lags to 10 and the DOF to 10.

    2. Set Number of Lags to 15 and the DOF to 15.

The test results appear in the Results table of the LBQ(Returns) document.

A Results table showing "Ljung-Box Q-Test for Autocorrelation (Returns); Null Hypothesis: The first m autocorrelations of Returns are jointly 0" for the LBQ (OSHORT) document. The table shows columns entitled select, null rejected, P-value, test statistic, Critical Value, Lags, DOF, and Significance Level. There are 3 rows below the headings.

The Ljung-Box Q-test null hypothesis that all autocorrelations up to the tested lags are zero is not rejected for tests at lags 5, 10, and 15. These results, and the ACF and PACF, suggest that a conditional mean model is not needed for this returns series.

Check for Conditional Heteroscedasticity

To check the returns for conditional heteroscedasticity, Econometric Modeler requires a series of squared residuals. After importing the squared residuals into the app, visually assess whether there is conditional heteroscedasticity by plotting the ACF and PACF of the squared residuals. Then, determine the appropriate number of lags for a GARCH model of the returns by conducting Engle's ARCH test.

Compute the series of squared residuals at the command line by demeaning the returns, then squaring each element of the result.

Export Returns to the command line:

  1. In the Time Series pane, right-click Returns.

  2. In the context menu, select Export.

Returns appears in the MATLAB® Workspace.

Remove the mean from the returns, then square each element of the result. To ensure all series in the Time Series pane are synchronized, Econometric Modeler prepends first-differenced series with a NaN value. Therefore, to estimate the sample mean, use mean(Returns,'omitnan').

Residuals = Returns - mean(Returns,'omitnan');
Residuals2 = Residuals.^2;

Create a table containing the Returns and Residuals2 variables.

Tbl = table(Returns,Residuals,Residuals2);

Import Tbl into Econometric Modeler:

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

  2. The app must clear the right pane and all documents before importing new data. Therefore, after clicking Import, in the Econometric Modeler dialog box, click OK.

  3. In the Import Data dialog box, in the Import? column, select the check box for the Tbl variable.

  4. Click Import.

The variables appear in the Time Series pane, and a time series plot of all the series appears in the Time Series Plot(Residuals) figure window.

Plot the ACF and PACF of the squared residuals.

  1. Close the Time Series Plot(Residuals) figure window.

  2. In the Time Series pane, select the Residuals2 time series.

  3. Click the Plots tab, then click ACF.

  4. Click the Plots tab, then click PACF.

  5. Drag the PACF(Residuals2) figure window below the ACF(Residuals2) figure window so that you can view them simultaneously.

This set of time series plots compare the differences between the Sample Autocorrelation Function of the variable Returns2 in the ACF tab and the Sample Partial Autocorrelation Function of the variable Returns2 in the PACF tab. Lag is shown on the x axis and blue horizontal lines indicate Confidence Bounds.

The sample ACF and PACF of the squared returns show significant autocorrelation. This result suggests that a GARCH model with lagged variances and lagged squared innovations might be appropriate for modeling the returns.

Conduct Engle's ARCH test on the residuals series. Specify a two-lag ARCH model alternative hypothesis.

  1. Close all figure windows.

  2. In the Time Series pane, select the Residuals time series.

  3. On the Econometric Modeler tab, in the Tests section, click New Test > Engle's ARCH Test.

  4. On the ARCH tab, in the Parameters section, set Number of Lags to 2.

  5. In the Tests section, click Run Test.

The test results appear in the Results table of the ARCH(Residuals) document.

This is a screen shot of the results table with the heading "Engle's ARCH Test for Heteroscedasticity (Residuals); Null Hypothesis: Residuals exhibits no ARCH effects". There is one row in the table. The table shows Null Rejected with a designation of "true", P-Value of 0, Test Statistic of 129.3001, Critical Value of 5.9915, Lags with a value of 2, and Significance Level of 0.0500.

Engle's ARCH test rejects the null hypothesis of no ARCH effects in favor of the alternative ARCH model with two lagged squared innovations. An ARCH model with two lagged innovations is locally equivalent to a GARCH(1,1) model.

Create and Fit GARCH Model

Fit a GARCH(1,1) model to the returns series.

  1. In the Time Series pane, select the Returns time series.

  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 GARCH Models section, click GARCH.

  4. In the GARCH Model Parameters dialog box, on the Lag Order tab:

    1. Set GARCH Degree to 1.

    2. Set ARCH Degree to 1.

    3. Because the returns required demeaning, include an offset by selecting the Include Offset check box.

    GARCH Model Parameters dialog box with Lag Order tab selected showing ARCH Order and GARCH Order set to 1 and the "Include Offset" check box is selected. A model equation section is below these ARCH and GARCH degrees. The "Details", "Estimate" and "Cancel" buttons are at the bottom of the dialog box, below the equation.

  5. Click Estimate.

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

This screen shot shows time series plots of Conditional Variances and Standardized Residuals for the variable GARCH_Returns on the left and two tables for Parameters and Goodness of Fit to the right.

An alternative way to select lags for a GARCH model is by fitting several models containing different lag polynomial degrees. Then, choose the model yielding the minimal AIC.

See Also

Apps

Objects

Functions

Related Topics