LB.test | R Documentation |
This function modifies the Box.test function in the stats package, and it computes the Ljung-Box or Box-Pierce tests checking whether or not the residuals appear to be white noise.
LB.test(model, lag = 12, type = c("Ljung-Box", "Box-Pierce"), no.error = FALSE, omit.initial = TRUE)
model |
model fit from the arima function |
lag |
number of lags of the autocorrelation of the residuals to be included in the test statistic. (default=12) |
type |
either Ljung-Box or Box-Pierce |
no.error |
a system variable; normally it is not changed |
omit.initial |
if true, (d+Ds) initial residuals are omitted from the test |
a list:
statistics |
test statistic |
p.value |
p-value |
parameter |
d.f. of the Chi-square test |
lag |
no of lags |
Kung-Sik Chan, based on A. Trapletti's work on the Box.test function in the stats package
Box, G. E. P. and Pierce, D. A. (1970), Distribution of residual correlations in autoregressive-integrated moving average time series models. Journal of the American Statistical Association, 65, 15091526.
Ljung, G. M. and Box, G. E. P. (1978), On a measure of lack of fit in time series models. Biometrika 65, 553564.
data(color) m1.color=arima(color,order=c(1,0,0)) LB.test(m1.color)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.