Documentation

archtest

Engle test for residual heteroscedasticity

Syntax

  • h = archtest(res) example
  • h = archtest(res,Name,Value) example
  • [h,pValue] = archtest(___) example
  • [h,pValue,stat,cValue] = archtest(___) example

Description

example

h = archtest(res) returns a logical value with the rejection decision from conducting the Engle's ARCH test for residual heteroscedasticity in the univariate residual series res.

example

h = archtest(res,Name,Value) uses additional options specified by one or more Name,Value pair arguments.

  • If any Name,Value pair argument is a vector, then all Name,Value pair arguments that you specify must be vectors of equal length or scalars. archtest(res,Name,Value) treats each element of a vector input as a separate test, and returns a vector of rejection decisions.

  • If any Name,Value pair argument is a row vector, then archtest(res,Name,Value) returns row vectors.

example

[h,pValue] = archtest(___) returns the rejection decision and p-value for the hypothesis test, using any of the input arguments in the previous syntaxes.

example

[h,pValue,stat,cValue] = archtest(___) additionally returns the test statistic (stat) and critical value (cValue) for the hypothesis test.

Examples

expand all

Test a Time Series for ARCH Effects

Load the Deutschmark/British pound foreign-exchange rate data set.

load Data_MarkPound

Convert the prices to returns.

returns = price2ret(Data);

Compute the deviations of the return series.

residuals = returns - mean(returns);

Test the return series for ARCH effects using the residuals.

h = archtest(residuals)
h =

     1

The result h = 1 indicates that you should reject null hypothesis of no conditional heteroscedasticity and conclude that there are significant ARCH effects in the return series.

Specify the Lag Structure in an ARCH Test

To draw valid inferences from Engle's ARCH test, you should determine a suitable number of lags for the model. Do this by fitting the model over a range of plausible lags, and comparing the fitted models. Choose the number of lags that yields the best fitting model for the ARCH test.

Load and Process the Data

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

load Data_EquityIdx;
price = DataTable.NASDAQ;
ret = 100*price2ret(price);
T = length(ret);

figure
plot(ret)
xlim([0,T])
title('NASDAQ Daily Returns')

The last quarter of the return series seems to have higher variance than the first three quarters. This volatile behavior indicates conditional heteroscedasticity. Also, the series seems to fluctuate at a constant level.

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.

Determine a Suitable Number of Lags

Fit the model over a grid of lags. Choose the number of lags that corresponds to the best fitting model.

numLags = 4;
logL = zeros(numLags,1); % Preallocate fit statistics

for k = 1:numLags
    Mdl = garch(0,numLags); % Specify garch model
    [~,~,logL(k)] = estimate(Mdl,ret,'Display','off'); % Obtain loglikelihood
end

fitStats = aicbic(logL,1:numLags) % Get AIC
lags = find(min(fitStats)) % Obtain suitable number of lags
fitStats =

   1.0e+03 *

    9.7732
    9.7752
    9.7772
    9.7792


lags =

     1

lags = 1 indicates that it is reasonable to conduct the ARCH test using one lag.

Conduct the ARCH Test

Calculate the residuals, and use them to conduct the ARCH test at a 1% significance level.

r = ret - mean(ret); % Returns fluctuate at constant level
[h,pValue,stat,cValue] = archtest(ret,'Lags',lags,'Alpha',0.01)
h =

     1


pValue =

     0


stat =

  204.2625


cValue =

    6.6349

h = 1 indicates that the software rejects the null hypothesis of no ARCH effects. pValue = 0 indicates that the evidence is strong for the rejection of the null.

Input Arguments

expand all

res — Residual seriesvector

Residual series for which the software computes the test statistic, specified as a vector. The last element corresponds to the most recent observation.

Typically, you fit a model to an observed time series, and res is the (standardized) residuals from the fitted model.

Data Types: double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'lags',1:4,'alpha',0.1 specifies four tests with 1, 2, 3, and 4 lagged terms conducted at the 0.1 significance level.

'lags' — Number of lagged terms1 (default) | positive integer | vector of positive integers

Number of lagged terms to include in the test statistic calculation, specified as the comma-separated pair consisting of 'lags' and a positive integer or vector of positive integers.

Use a vector to conduct multiple tests.

Each element of lags must be less than length(res) – 1.

Example: 'lags',1:4

'alpha' — Significance levels0.05 (default) | scalar | vector

Significance levels for the hypothesis tests, specified as the comma-separated pair consisting of 'alpha' and a scalar or vector.

Use a vector to conduct multiple tests.

Each element of alpha must be greater than 0 and less than 1.

Example: 'alpha',0.01

Output Arguments

expand all

h — Test rejection decisionslogical | vector of logicals

Test rejection decisions, returned as a logical value or vector of logical values with length equal to the number of tests that the software conducts.

  • h = 1 indicates rejection of the no ARCH effects null hypothesis in favor of the alternative.

  • h = 0 indicates failure to reject the no ARCH effects null hypothesis.

pValue — Test statistic p-valuesscalar | vector

Test statistic p-values, returned as a scalar or vector with length equal to the number of tests that the software conducts.

stat — Test statisticsscalar | vector

Test statistics, returned as a scalar or vector with length equal to the number of tests that the software conducts.

cValue — Critical valuesscalar | vector

Critical values, returned as a scalar or vector with length equal to the number of tests that the software conducts.

More About

expand all

Engle's ARCH Test

Engle's ARCH test assesses the null hypothesis that a series of residuals (rt) exhibits no conditional heteroscedasticity (ARCH effects), against the alternative that an ARCH(L) model describes the series.

The ARCH(L) model has the following form:

rt2=a0+a1rt12++aLrtL2+et,

where there is at least one aj ≠ 0, j = 0,..,L.

The test statistic is the Lagrange multiplier statistic TR2, where:

  • T is the sample size.

  • R2 is the coefficient of determination from fitting the ARCH(L) model for a number of lags (L) via regression.

Under the null hypothesis, the asymptotic distribution of the test statistic is chi-square with L degrees of freedom.

Tips

  • You must determine a suitable number of lags to draw valid inferences from Engle's ARCH test. One method is to:

    1. Fit a sequence of arima, garch, egarch, or gjr models using estimate. Restrict each model by specifying progressively smaller ARCH lags (i.e., ARCH effects corresponding to increasingly smaller lag polynomial terms).

    2. Obtain loglikelihoods from the estimated models.

    3. Use lratiotest to evaluate the significance of each restriction. Alternatively, determine information criteria using aicbic and combine them with measures of fit.

  • Residuals in an ARCH process are dependent, but not correlated. Thus, archtest tests for heteroscedasticity without autocorrelation. To test for autocorrelation, use lbqtest.

  • GARCH(P,Q) processes are locally equivalent to ARCH(P + Q) processes. If archtest(res,'lags',lags) shows evidence of conditional heteroscedasticity in residuals from a mean model, then it might be better to model a GARCH(P,Q) model with P + Q = lags.

References

[1] Box, G. E. P., G.M. Jenkins, and G.C. Reinsel. Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.

[2] Engle, R. "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 96, 1988, pp. 893–920.

Was this topic helpful?