Ljung-Box Q Test for Autocorrelation
Also known as: Ljung-Box Q Test, Modified Box-Pierce Test, Portmanteau Test for Autocorrelation, Otokorelasyon Portmanteau Testi
The Ljung-Box Q test is a diagnostic portmanteau test proposed by Ljung and Box (1978) to assess whether a group of autocorrelations in a time series residual sequence is jointly zero. It is widely used to evaluate the adequacy of fitted time series models — especially ARIMA models — by testing whether remaining residuals exhibit any systematic pattern. The test is applicable in econometrics, finance, and any field that relies on temporal data modeling.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use the Ljung-Box test as a post-estimation diagnostic after fitting ARIMA, GARCH, or other time series models to check residual adequacy. It is appropriate when the series is stationary or the residuals from a model are being examined. Key assumptions include that the null distribution of Q is asymptotically chi-squared, which requires a reasonably large sample. The choice of h (maximum lag) matters: common recommendations range from h = ln(n) to h = min(10, n/5). Alternatives include the Box-Pierce test (less accurate in small samples) and the Breusch-Godfrey test (more powerful against specific AR alternatives in regression residuals).
Strengths & limitations
- Tests joint significance of multiple autocorrelations simultaneously, avoiding the multiple-testing problem of individual lag tests.
- Finite-sample correction improves chi-squared approximation over the original Box-Pierce statistic.
- Applicable to residuals of ARIMA and GARCH models with straightforward degrees-of-freedom adjustment.
- Implemented in virtually all major statistical software (R, Python statsmodels, EViews, Stata, SAS).
- Performance depends on the chosen maximum lag h; no universally optimal rule exists for selecting h.
- Chi-squared approximation may be poor in very small samples or when residuals are non-normal.
- Not designed as a primary specification test for regression models; the Breusch-Godfrey test is more appropriate in that context.
- Low power against certain long-memory or nonlinear dependence structures that produce small individual autocorrelations across many lags.
Frequently asked
How many lags h should I use for the Ljung-Box test?
There is no universal rule, but common practical guidelines suggest h = ln(n) for longer series or h = min(10, n/5) for shorter ones. Some authors recommend testing at h = 10 and h = 20 for robustness. Choosing too few lags may miss higher-order dependencies, while too many lags reduce power by increasing degrees of freedom. Sensitivity analysis across a range of h values is good practice.
What is the difference between the Ljung-Box and Box-Pierce tests?
Both are portmanteau tests based on the same residual autocorrelations, but the Box-Pierce statistic uses the simpler form Q = n Σ ρ̂_k², whereas the Ljung-Box statistic uses the finite-sample correction n(n+2) Σ ρ̂_k²/(n−k). The Ljung-Box version converges faster to its chi-squared limit and has better size properties in small samples; it is therefore preferred in virtually all modern applications.
If the Ljung-Box test rejects H₀, what should I do?
Rejection indicates residual autocorrelation, meaning the fitted model has not captured all temporal dependence. The appropriate response depends on context: for ARIMA models, consider increasing the AR or MA order; for regression residuals, investigate omitted lagged variables or switch to an ARIMA-error specification. Always examine the sample ACF/PACF of residuals to identify the lag structure causing rejection before refitting.
Sources
- Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297–303. DOI: 10.1093/biomet/65.2.297 ↗
How to cite this page
ScholarGate. (2026, June 2). Ljung-Box Q Test for Autocorrelation. ScholarGate. https://scholargate.app/en/econometrics/ljung-box-test
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- ARIMAEconometrics↔ compare
- Breusch-Godfrey TestEconometrics↔ compare
- Durbin-Watson TestEconometrics↔ compare