Hypothesis testEconometricsAutocorrelationTest

Ljung-Box Q Test for Autocorrelation

Also known as: Ljung-Box Q Test, Modified Box-Pierce Test, Portmanteau Test for Autocorrelation, Otokorelasyon Portmanteau Testi

OriginatorGreta Ljung & George BoxYear1978Sources1Related methods4

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.

Key highlights

  • 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).

Intuition

This section is available to Pro members. Upgrade to Pro

How it works

This section is available to Pro members. Upgrade to Pro

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

Strengths
  • 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).
Limitations
  • 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.

Common pitfalls

This section is available to Pro members. Upgrade to Pro

Applications

This section is available to Pro members. Upgrade to Pro

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

  1. 1.
    Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297–303.

You have read it. What now?

Cite this page

ScholarGate. (2026, June 2). Ljung-Box Test. ScholarGate. https://scholargate.app/econometrics/ljung-box-test

Ljung-Box Q Test for Autocorrelation | ScholarGate