help armadiagsee also: corrgram ac pac wntestq-------------------------------------------------------------------------------

Post-estimation residual diagnostics for time series

Syntax

armadiag[varname] [if] [in] [,archdfc(d)hetrobustlags(p)level(alpha)ywnographtablelinscaleforce]

Description

armadiagis a post-estimation diagnostic tool for use afterarch,arimaorregress. The residuals (standardized residuals witharch) are plotted together with autocorrelations, partial autocorrelations and p-values of the Ljung-Box Q-statistic. The variablevarnameis used instead of residuals ifvarnameis specified.Optionally the square of the variable/residuals/standardized residuals is used to allow detection of (remaining) ARCH-effects.

The degrees of freedom of the Q-statistic are adjusted for the number of estimated ARMA-parameters and/or lags of the dependent variable. When the squared residuals are investigated the degrees of freedom are corrected for the number of ARCH-parameters.

Residuals are calculated for the estimation sample unless

iforinis specified.You must

tssetyour data before usingarmadiag, see[TS] tsset.

varnamemay contain time-series operators; see tsvarlist.

Options

optionDescription -------------------------------------------------------------------------

archDiagnostics for ARCH, i.e. the square of the residuals, standardized residuals or variabe is plotted with autocorrelations, partial autocorrelations and Q-stat p-values for the square. Degrees of freedom are adjusted for the number or ARCH-parameters.

dfc(n)Override default degrees of freedom correction. The default is to subtract the number of lagged dependent variables and ARMA terms for models estimated witharch,arimaandregress. Ifarchis specified the number of ARCH-terms are subtracted for models estimated witharch.

hetrobustCalculate Q-statistics that are robust to heteroskedasticity of the ARCH-variety. Milhøj has shown that the variance of the estimated autocorrelations is different from 1/T when there is ARCH andhetrobustcorrects for this by scaling with a consistent estimate of the variance.

lags(p)The number of lags to calculate statistics for. Default is min(int(T/2)-2,40)

level(alpha)Level for "confidence bands" in autocorrelation and partial autocorrelation plots. Specified this way for consistency withacandpacwhich has it wrong. These are not confidence intervals, a confidence interval would be be centered on the estimate. They are 1-alphacritical values for testing the null that the autocorrelation or partial autocorrelation is zero. The default isalpha=95, i.e. 5% critical values.

ywCalculate partial autocorrelations by using Yule-Walker equations

nographDo not plot results.

tablePrint results in a table likecorrgram

linscalePlot p-values for Q-statistics on a linear scale. By default the p-values are plotted on what is almost a log scale to make the more interesting, small, p-values easier to distinguish.

forceCalculates statistics for residuals from other commands thanarch,arimaorregress.This may or may not makesense. Use at your own risk

ReferencesMilhøj, A., (1985), "The Moment Structure of ARCH Processes,"

Scandinavian Journal of Statistics, 12, 281-292.

ExamplesSetup

. webuse air2. gen lnair = ln(air)Plot data, autocorrelations and partial autocorrelations for model order identification

. armadiag lnair. armadiag d.lnair. armadiag s12.lnair. armadiag ds12.lnairFit "airline model" and plot residual diagnostics

. arima lnair, arima(0,1,1) sarima(0,1,1,12). armadiagCheck for presence of ARCH in residuals

. armadiag, arch

AuthorSune Karlsson, Örebro University, Sweden sune.karlsson@oru.se

Also see