Ljung-Box test
The Ljung-Box Q-statistics are given by:
LB(k)=n×(n+2)×∑Kk=1ρ2a,kn−k, [1]
where:
ρ2a,k is the autocorrelation coefficient at lag k of the residuals ˆat.
n is the number of terms in differenced series;
K is the maximum lag being considered, set in JDemetra+ to 24 (monthly series) or 8 (quarterly series).
If the residuals are random (which is the case for residuals from a well specified model), they will be distributed as χ2(K−m), where m is the number of parameters in the model which has been fitted to the data.
The Ljung-Box and Box-Pierce tests sometimes fail to reject a poorly fitting model. Therefore, care should be taken not to accept a model on a basis of their results. For the description of autocorrelation concept see section Autocorrelation function and partial autocorrelation function.