Ljung-Box Test for Serial Correlation in Returns
Consider a zero-mean return series $\{r_t\}_{t=1}^{n}$. Define the sample autocorrelations:
$$\hat{\rho}(h) = \frac{\sum_{t=h+1}^{n} r_t \, r_{t-h}}{\sum_{t=1}^{n} r_t^2}$$
(i) Write down the Ljung-Box portmanteau statistic $Q(m)$ and state its asymptotic null distribution under the assumption that $\{r_t\}$ is i.i.d. noise.
(ii) Discuss the bias-variance tradeoff in choosing the number of lags $m$. How does conditional heteroskedasticity (e.g., GARCH effects) affect the validity of the standard Ljung-Box test? Propose a HAC-adjusted variant that remains valid under heteroskedasticity.
Hints
- Recall the Ljung-Box statistic improves on Box-Pierce by adding the finite-sample correction factor $(n+2)/(n-h)$. Under i.i.d. noise, each $\hat{\rho}(h)$ is asymptotically $N(0, 1/n)$.
- For the bias-variance tradeoff in $m$: too few lags misses high-order correlation, too many lags dilutes power. Think about what each extra lag contributes under the null versus the alternative.
- Under GARCH, $\text{Var}(\hat{\rho}(h))$ depends on the kurtosis of returns, not just $1/n$. Replace the standard normalization with $\hat{v}(h) = n \sum r_t^2 r_{t-h}^2 / (\sum r_t^2)^2$.
Worked Solution
How to Think About It: The Ljung-Box test is the workhorse for checking whether a return series has any predictable structure -- serial correlation. On a trading desk, this is the first thing you run on residuals from any model: if the autocorrelations are jointly significant, your model is missing something. The test aggregates autocorrelations across multiple lags into a single statistic, which is more powerful than checking each lag individually.
Key Insight: The standard Ljung-Box test assumes i.i.d. returns under the null. But financial returns are almost never i.i.d. -- they have volatility clustering (GARCH effects). This heteroskedasticity inflates the variance of sample autocorrelations, causing the standard test to over-reject. You need a HAC correction to get reliable p-values.
The Method:
(i) The Ljung-Box Statistic:
The statistic is:
$$Q(m) = n(n+2) \sum_{h=1}^{m} \frac{\hat{\rho}(h)^2}{n - h}$$
Under $H_0$: $\{r_t\}$ is i.i.d. with finite variance, as $n \to \infty$:
$$Q(m) \xrightarrow{d} \chi^2(m)$$
This is an improvement over the original Box-Pierce statistic $Q_{BP} = n \sum_{h=1}^{m} \hat{\rho}(h)^2$, which has worse finite-sample properties. The Ljung-Box correction factor $(n+2)/(n-h)$ accounts for the downward bias in $\hat{\rho}(h)^2$ as an estimator of $\rho(h)^2$.
Reject $H_0$ at level $\alpha$ if $Q(m) > \chi^2_{1-\alpha}(m)$.
(ii) Choosing $m$ -- Bias-Variance Tradeoff:
- Too small $m$: The test has good power against low-order serial correlation but misses higher-order patterns. If the true autocorrelation is at lag $h > m$, the test is blind to it.
- Too large $m$: Including many lags where $\rho(h) = 0$ dilutes the signal. Each zero-autocorrelation lag adds noise ($\hat{\rho}(h)^2$ has expectation $\approx 1/n$ under the null), reducing power against concentrated alternatives.
- Rules of thumb: Common choices are $m \approx \ln(n)$ (parsimonious) or $m \approx n^{1/3}$ (data-driven rate). For daily returns with $n \approx 250$, $m = 5$ to $20$ is typical. For intraday data, look at more lags.
Effect of Heteroskedasticity:
Under conditional heteroskedasticity (e.g., $r_t = \sigma_t \epsilon_t$ with $\epsilon_t$ i.i.d. but $\sigma_t$ time-varying), the returns are uncorrelated but not independent. The problem: under GARCH-type dynamics,
$$\text{Var}(\hat{\rho}(h)) \neq \frac{1}{n}$$
Specifically, $\text{Var}(\hat{\rho}(h))$ depends on the fourth-moment structure (kurtosis) of the returns. Since financial returns are heavy-tailed, $\text{Var}(\hat{\rho}(h)) > 1/n$, and the standard $\chi^2(m)$ critical values are too small. The test over-rejects, producing spurious evidence of serial correlation.
HAC-Adjusted Variant:
Replace the standard normalization with a heteroskedasticity-consistent variance estimate. Define:
$$Q^{*}(m) = n \sum_{h=1}^{m} \frac{\hat{\rho}(h)^2}{\hat{v}(h)}$$
where $\hat{v}(h)$ is a consistent estimator of $n \cdot \text{Var}(\hat{\rho}(h))$ under heteroskedasticity:
$$\hat{v}(h) = \frac{\sum_{t=h+1}^{n} r_t^2 \, r_{t-h}^2}{\left(\sum_{t=1}^{n} r_t^2\right)^2 / n}$$
This is the approach of Lobato, Nankervis, and Savin (2001). Under GARCH-type heteroskedasticity and the null of no serial correlation, $Q^{*}(m) \xrightarrow{d} \chi^2(m)$.
An alternative is the approach of Fisher and Gallagher, who use a wild bootstrap to obtain critical values: resample $r_t^{*} = r_t \cdot \eta_t$ where $\eta_t$ are i.i.d. Rademacher ($\pm 1$), preserving the heteroskedastic structure while destroying serial correlation.
Practical Considerations: - Always plot the sample ACF before running the test -- visual inspection catches patterns the test might miss. - For model residuals (e.g., after fitting ARMA), the degrees of freedom adjust: $Q(m) \sim \chi^2(m - p - q)$. - In practice, run both the standard and HAC-adjusted tests. If they disagree, trust the HAC version.
Answer: The Ljung-Box statistic is $Q(m) = n(n+2)\sum_{h=1}^{m} \hat{\rho}(h)^2/(n-h) \sim \chi^2(m)$ under i.i.d. null. Choose $m$ balancing detection of high-lag patterns (large $m$) against power dilution (small $m$). Heteroskedasticity inflates autocorrelation variance, causing over-rejection; fix this with a HAC-adjusted variant that scales each $\hat{\rho}(h)^2$ by its heteroskedasticity-robust variance estimate.
Intuition
The Ljung-Box test answers a simple question: do past returns help predict future returns? It pools evidence across multiple lags because predictability might lurk at any horizon. The tricky part in finance is that returns exhibit volatility clustering -- big moves follow big moves -- which makes the raw autocorrelations noisier than the standard theory assumes. If you use textbook critical values, you'll see "serial correlation" that is really just excess kurtosis messing with your variance estimates.
This is a recurring theme in financial econometrics: most classical tests assume i.i.d. or at least homoskedastic errors, and most financial data violates that. The fix is always the same conceptually -- estimate the variance of your test statistic under the actual data-generating process, not the convenient textbook one. HAC adjustments, wild bootstraps, and robust standard errors are all manifestations of this principle.