Skip to contents

Compute the McLeod-Ljung-Box test statistic for examining the null hypothesis of periodic white noise.

Usage

pwn_McLeodLjungBox_test(acf, nepoch, use = 1:maxlag,
                 maxlag = ncol(as.matrix(acf)) - 1,
                 period = nrow(as.matrix(acf)), fitdf = numeric(period))

Arguments

acf

the sample periodic autocorrelation function of the time series.

nepoch

number of cycles used in computing the acf.

use

number of lags to use, may be a vector.

maxlag

maximal lag.

period

number of seasons in a cycle.

fitdf

degrees of freedom corrections for the number of estimated parameters, see Details.

Details

The McLeod-Ljung-Box test can be used to test the null hypothesis of periodic white noise.

If acf contains sample autocorrelations of residuals from a fitted model, a correction of the degrees of freedom is strongly recommended.

Argument fitdf is a vector specifying how may degrees of freedom to subtract for each season. In the case of PAR models fitdf can be set to the PAR orders.

The value of the statistic is set to NA where the correction for degrees of freedom results in negative numbers.

Value

A list containing the following components:

statistic

the value of the test statistic for each lag specified by use.

df

the corresponding degrees of freedom

Author

Georgi N. Boshnakov

Note

TODO: Consolidate this and similar tests!

There is a typo in McLeod (1994, eq. (4.5)) , noted by (McLeod 1995) .

References

McLeod AI (1994). “Diagnostic checking of periodic autoregression models with application.” Journal of Time Series Analysis, 15(2), 221--233.

McLeod AI (1995). “Diagnostic checking of periodic autoregression models with application.” Journal of Time Series Analysis, 16(6), 647-648. doi: 10.1111/j.1467-9892.1995.tb00260.x , This corrects some typos in the eponimous article McLeod (1994).

See also

Box.test for the non-periodic case