Main Content

Detect ARCH Effects

Test Autocorrelation of Squared Residuals

This example shows how to inspect a squared residual series for autocorrelation by plotting the sample autocorrelation function (ACF) and partial autocorrelation function (PACF). Then, conduct a Ljung-Box Q-test to more formally assess autocorrelation.

加载数据。

Load the NASDAQ data included with the toolbox. Convert the daily close composite index series to a percentage return series.

loadData_EquityIdx; y = DataTable.NASDAQ; r = 100*price2ret(y); T = length(r); figure plot(r) xlim([0,T]) title('NASDAQ Daily Returns')

Figure contains an axes object. The axes object with title NASDAQ Daily Returns contains an object of type line.

The returns appear to fluctuate around a constant level, but exhibit 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.

The returns are of relatively high frequency. Therefore, the daily changes can be small. For numerical stability, it is good practice to scale such data.

Plot the Sample ACF and PACF.

绘制Squared残差系列的样品ACF和PACF。

e = r - mean(r); figure subplot(2,1,1) autocorr(e.^2) subplot(2,1,2) parcorr(e.^2)

Figure contains 2 axes objects. Axes object 1 with title Sample Autocorrelation Function contains 4 objects of type stem, line. Axes object 2 with title Sample Partial Autocorrelation Function contains 4 objects of type stem, line.

样品ACF和PACF在平方残留系列中显示出显着的自相关。这表明存在挥发性聚类存在于残余系列中。

Conduct a Ljung-Box Q-test.

Conduct a Ljung-Box Q-test on the squared residual series at lags 5 and 10.

[h,p] = lbqtest(e.^2,'滞后',[5,10])
h =1x2 logical array1 1
p =1×20 0

The null hypothesis is rejected for the two tests (h = 1). The p values for both tests is0。因此,并不是所有的自我滞后5 (or 10) are zero, indicating volatility clustering in the residual series.

进行恩格尔的拱门测试

This example shows how to conduct Engle's ARCH test for conditional heteroscedasticity.

加载数据。

Load the NASDAQ data included with the toolbox. Convert the daily close composite index series to a percentage return series.

loadData_EquityIdx; y = DataTable.NASDAQ; r = 100*price2ret(y); T = length(r); figure plot(r) xlim([0,T]) title('NASDAQ Daily Returns')

Figure contains an axes object. The axes object with title NASDAQ Daily Returns contains an object of type line.

The returns appear to fluctuate around a constant level, but exhibit 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.

The returns are of relatively high frequency. Therefore, the daily changes can be small. For numerical stability, it is good practice to scale such data.

进行恩格尔的拱门测试。

Conduct Engle's ARCH test for conditional heteroscedasticity on the residual series, using two lags in the alternative hypothesis.

e = r - mean(r); [h,p,fStat,crit] = archtest(e,'滞后',2)
h =logical1
p = 0
fStat = 399.9693
crit = 5.9915

The null hypothesis is soundly rejected (h = 1,p = 0) in favor of the ARCH(2) alternative. The F statistic for the test is399.97, much larger than the critical value from the χ 2 distribution with two degrees of freedom,5.99

The test concludes there is significant volatility clustering in the residual series.

See Also

|||

Related Examples

More About