Outline the Ljung-Box Q statistic and the Box-Pierce Q statistic, including how each is calculated and what its value indicates.
The idea
Both tests ask whether the first m autocorrelations of a series, usually model residuals, are jointly zero. The Box-Pierce statistic sums the squared autocorrelations from lag 1 to lag m, and is Box-Pierce = T × Σρ̂k². The Ljung-Box statistic, which reweights each term, is Ljung-Box = T × (T + 2) × Σ(ρ̂k² ÷ (T − k)). Each Ljung-Box term is weighted by T × (T + 2) ÷ (T − k) instead of T. That makes the statistic larger and better approximated by a chi-squared distribution in small samples, so it is the preferred version. Under the null of no autocorrelation each Q follows a chi-squared with m degrees of freedom. When testing ARMA residuals, reduce that by the number of estimated ARMA parameters. A large Q, above the critical value, rejects the null and indicates that at least one autocorrelation is nonzero, so the model is missing structure. The usual slips are using the wrong degrees of freedom or summing the autocorrelations without squaring.
Formulas
Box-Pierce Q statistic
Q = T × Σρ̂ₖ²
- T
- the number of observations
- ρ̂ₖ
- the sample autocorrelation at lag k, summed over k = 1 to m
Chi-squared with m degrees of freedom under no autocorrelation, fewer when testing ARMA residuals. Weaker than Ljung-Box in small samples.
Ljung-Box Q statistic
Q = T(T + 2) × Σ[ρ̂ₖ² ÷ (T − k)]
- T
- the number of observations
- ρ̂ₖ
- the sample autocorrelation at lag k
- k
- the lag, summed from 1 to m
Chi-squared with m degrees of freedom, less p + q for ARMA residuals. The trap is forgetting to square the autocorrelations.
A practice question
The null hypothesis of the Ljung-Box and Box-Pierce tests is that:
- the series has a unit rootWhy not: Unit roots are tested by Dickey-Fuller type tests, not Q statistics.
- the first m autocorrelations of the series are all zero - correct
- the first autocorrelation equals the first partial autocorrelationWhy not: This is always true by construction and not a hypothesis tested by Q.
- the variance of the series is constantWhy not: Constant variance is tested by heteroskedasticity tests; the Q statistics test serial correlation.
Both Q statistics test joint no-autocorrelation up to lag m (H0: rho1 = ... = rho_m = 0). Rejection means at least one autocorrelation is nonzero.
A harder one
A Ljung-Box test on 5 lags of a raw series of daily returns gives Q = 12.3. The 5% critical value of a chi-squared distribution with 5 degrees of freedom is 11.07. What is the correct conclusion?
- Reject the null: at least one of the first five autocorrelations is nonzero - correct
- Fail to reject the null: the returns are serially uncorrelatedWhy not: Q exceeds the critical value of 11.07, so the null of no autocorrelation is rejected.
- Reject the null: all of the first five autocorrelations are nonzeroWhy not: Rejection says at least one autocorrelation differs from zero, not that all do.
- Reject the null: the returns are non-stationaryWhy not: The Q test addresses serial correlation, not stationarity; a stationary series can have autocorrelation.
The test is joint: H0 is that all five autocorrelations are zero. Q = 12.3 > 11.07 rejects H0, which only implies that at least one is nonzero.
The hardest tier
For a sample of T = 60, the first two sample autocorrelations are 0.30 and 0.25. The 1% critical value of the chi-squared distribution with 2 degrees of freedom is 9.21. At the 1% level, the conclusions are:
- Both statistics reject the null of no autocorrelationWhy not: Box-Pierce gives T x (0.09 + 0.0625) = 9.15, which is below 9.21, so it does not reject.
- Neither statistic rejects the null of no autocorrelationWhy not: The Ljung-Box value, with its T(T+2)/(T-k) weights, is 9.68, above 9.21, so it rejects.
- Ljung-Box rejects the null of no autocorrelation; Box-Pierce does not - correct
- Box-Pierce rejects the null; Ljung-Box does notWhy not: Reverses the two: the Ljung-Box weights T(T+2)/(T-k) exceed T, so its Q is the larger one.
Box-Pierce = 60 x 0.1525 = 9.15 < 9.21, so no rejection. Ljung-Box = 60 x 62 x (0.09/59 + 0.0625/58) = 9.68 > 9.21, so it rejects. The weights make Ljung-Box larger.
In the app: 6 practice questions on this outcome, spaced review that brings it back before you forget it.
Start free →More in Stationary Time Series
- Outline what a series must satisfy in order to be covariance stationary.
- Give definitions for the autocorrelation function and for the autocovariance function.
- Define white noise and explain how its independent form and its normal (Gaussian) form differ.
- Define autoregressive (AR) processes, describe their properties and compute the series for an AR process from given parameters.
- Define moving average (MA) processes, describe their properties and compute the series for an MA process from given parameters.
- Describe the action of a lag operator, derive a time series process's lag polynomial, and judge stationarity using characteristic equations.
- Explain what mean reversion is and calculate the level a series reverts to.
- Give the definition of autoregressive moving average (ARMA) processes and describe their properties.
- Outline how AR, MA and ARMA processes are applied, and use model selection criteria to pick the time series model that fits best.
- Outline autocorrelation and partial autocorrelation as measured on a sample.
- Describe the way forecasts are produced from ARMA models.
- Outline what part mean reversion plays in forecasts over long horizons.
- Describe how a covariance-stationary ARMA model can represent seasonality.