Box.test (x, lag = 1, type=c("Box-Pierce", "Ljung-Box"))
x
| a numeric vector or univariate time series. |
lag
|
the statistic will be based on lag
autocorrelation coefficients.
|
type
| test to be performed: partial matching is used. |
x
is computed."htest"
containing the following components:
statistic
| the value of the test statistic. |
parameter
| the degrees of freedom of the approximate chi-square distribution of the test statistic. |
p.value
| the p-value of the test. |
method
| a character string indicating which type of test was performed. |
data.name
| a character string giving the name of the data. |
Ljung, G. M. and Box, G. E. P. (1978) On a measure of lack of fit in time series models. Biometrika 65, 553-564.
Harvey, A. C. (1993) Time Series Models, 2nd Edition, Harvester Wheatsheaf, NY, pp. 44, 45.
x <- rnorm (100) Box.test (x, lag = 1) Box.test (x, lag = 1, type="Ljung")