Engle test for residual heteroscedasticity
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.
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 = 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.
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.
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.
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.
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
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.
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.
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.
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.
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:
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.
You must determine a suitable number of lags to draw valid inferences from Engle's ARCH test. One method is to:
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).
Obtain loglikelihoods from the estimated models.
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.
 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.
 Engle, R. "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 96, 1988, pp. 893–920.