arima.diag(z, acf.resid=T, gof.lag=10, lag.max=<<see below>>, resid=F, std.resid=T, plot=T, type="h",...)
arima.mle
.
TRUE
, the autocorrelation of the residuals will be returned.
gof.lag
plus
the number of model parameters and a number
proportional to the logarithm of the length of the series.
gof.lag
plus the number of model parameters is the
number of lags to use for computing the Portmanteau goodness of fit statistic.
If
gof.lag=0
, then the statistic will not be computed
TRUE
, then the residuals will be returned.
TRUE
, then the standardized residuals will be returned.
TRUE
, the diagnostics will be plotted using
the function
arima.diag.plot
.
"h"
;
"l"
and
"p"
are other valid choices.
arima.diag.plot
.
plot=TRUE
)
with the following elements:
acf
for details.
lag
,
statistic
,
df
,
p.value
.
lag
is a vector of the number of lags used to compute the statistics.
statistic
is the vector of statistics corresponding to each lag used.
df
is the number of degrees of freedom the test statistics have
under the null hypothesis that the model is correct.
p.value
is a vector of the p-values for the statistics using a Chi-Squared
distribution with the appropriate degrees of freedom.
TRUE
, the diagnostics will be plotted using the
function
arima.diag.plot
The residuals (both standardized and raw) are computed using
the function
arima.filt
.
The autocorrelation function of the residuals is computed using
the function
acf
.
The portmanteau test statistic is derived from the autocorrelation
function of the residuals (see the chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis
for details).
Box, G. E. P. and Jenkins, G. M. (1976).
Time Series Analysis: Forecasting and Control.
Holden-Day, Oakland, Calif. Chapter 8.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
# compute and plot diagnostics for simulated AR(1) series with mean 5 x <- arima.sim(model=list(ar=.9)) + 5 xreg <- rep(1,100) fit <- arima.mle(x,model=list(ar=.9), xreg=xreg) diag <- arima.diag(fit) lynx.arma11 <- arima.mle(lynx, model=list(ar=0, ma=0)) arima.diag(lynx.arma11)