# archtest

Engle test for residual heteroscedasticity

## 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

collapse all

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

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 = logical
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.

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 the NASDAQ data included in the toolbox. Convert the daily close composite index series to a percentage return series.

dates = datetime(dates,"ConvertFrom",'datenum');

price = DataTable.NASDAQ;
ret = 100*price2ret(price);

figure
plot(dates(2:end),ret)
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 Suitable Number of Lags for Test

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); % Preallocation

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

aic = aicbic(logL,1:numLags);   % Get AIC
[~,lags] = min(aic)             % Obtain suitable number of lags
lags = 4

lags = 4 indicates that it is reasonable to include four lags in the ARCH test statistic.

Conduct 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(r,'Lags',lags,'Alpha',0.01)
h = logical
1

pValue = 0
stat = 460.5831
cValue = 13.2767

h = 1 indicates to reject the null hypothesis of no ARCH effects against the ARCH(4) alternative. pValue = 0 indicates that the evidence is strong for the rejection of the null.

## Input Arguments

collapse all

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 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 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.

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) – 2.

Example: 'Lags',1:4

Data Types: double

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

Data Types: double

## Output Arguments

collapse all

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.

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

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

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

collapse 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:

${r}_{t}{}^{2}={a}_{0}+{a}_{1}{r}_{t-1}^{2}+\dots {\text{+a}}_{L}{r}_{t-L}^{2}+{e}_{t},$

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.