Statistics Glossary → Ljung-Box (portmanteau) test
Ljung-Box (portmanteau) testconcept
A test of whether the autocorrelations of a time series, or of a model's residuals, over the first h lags are jointly zero.
If a time series model (such as ARIMA) has captured the temporal dependence in the data well, its residuals should behave like white noise, showing no significant autocorrelation at any lag. Instead of examining autocorrelations one by one, the Ljung-Box test combines the first h of them into a single statistic: Q = n(n + 2)·Σ r_k² / (n - k). The null hypothesis is that the first h autocorrelations are zero, and Q approximately follows a chi-square distribution. When applied to model residuals, the degrees of freedom are reduced by the number of estimated ARMA parameters.
A significant result shows that structure the model has not explained remains in the residuals, and the model needs improving. The choice of the number of lags h matters: too small an h misses long-lag (for example seasonal) relationships, too large an h reduces power; for seasonal data at least two seasonal periods are recommended. Applied to the squared residuals, the test can also check for conditional heteroscedasticity (ARCH effects). A non-significant result does not prove the model is correct; it only says that no clear autocorrelation was found at the lags tested.
An everyday example
A shop builds a model to forecast its daily sales. Applying the Ljung-Box test to the residuals reveals a strong autocorrelation at lag 7, and the test is significant. This shows the model has missed the weekly cycle (high sales every Saturday); once a seasonal component is added, the residuals come close to white noise and the test is no longer significant.
In MerQur
In GARCH, 'Ljung-Box lag and ARCH-LM lag' gives Q(k) for the standardized residuals and their squares; in the Unobserved Components Model, 'Ljung-Box lag (0 = automatic)' sets the lag of the residual test; in VAR, 'Diagnostic lags' include the lag of the portmanteau test. In the Time Series analysis, 'Number of ACF/PACF lags' sets the largest lag of the Ljung-Box table, and STL Seasonal Decomposition reports the Ljung-Box test in its residual diagnostics.
Analyses where this concept appears
Time SeriesSTL Seasonal DecompositionVAR (Vector Autoregression)GARCH (Volatility Model)Unobserved Components Model (Structural Time Series)
Related concepts
Autocorrelation (ACF) and partial autocorrelation (PACF) functionsWhite noise