Learning Outcome Statement
Explain how autocorrelations of the residuals can be used to test whether the autoregressive model fits the time series.
On the exam: You receive an estimated autoregressive order, the number of periodic residual observations, residual autocorrelations through a stated maximum lag, and a significance level or chi-square critical value. You state the hypotheses, calculate or interpret the Ljung-Box statistic, apply the upper-tail rejection rule, and conclude whether the model fits.
An autoregressive model uses earlier observations to explain the current observation. After fitting it, each residual is the actual observation minus the fitted observation for that period. If the model captured the predictable time pattern, residuals should not move together across periods. Residual autocorrelations near zero across tested lags are consistent with adequate AR fit, but they do not prove it.
| Quantity | Symbol | Unit or statement |
|---|---|---|
| Residual observations | $n$ | sample count |
| Estimated AR order | $p$ | periods |
| Maximum tested lag | $m$ | periods |
| Lag index | $k$ | periods |
| Sample residual autocorrelation | $\hat{\rho}_k$ | dimensionless estimate |
| Null hypothesis | $H_0$ | lags 1 through $m$ jointly zero |
| Alternative hypothesis | $H_a$ | at least one tested lag nonzero |
| Significance level | $\alpha$ | decimal upper-tail level |
Use $n$ for the residual sample count, and read the hats as sample estimates rather than population quantities. The test is joint residual dependence, not individual AR-coefficient significance.
To combine the evidence across the tested lags, the Ljung-Box statistic $Q(m)$ squares each sample residual autocorrelation and applies a finite-sample correction:
$$ Q(m)=n(n+2)\sum_{k=1}^{m}\frac{\hat{\rho}_k^2}{n-k} $$
Squaring removes the sign, so positive or negative dependence with the same magnitude pushes $Q$ in the same direction. The factor $n(n+2)$ scales the evidence with the sample size. The denominator $n-k$ applies a lag-specific finite-sample correction. Estimating the $p$ AR terms consumes approximately $p$ degrees of freedom, leaving $m-p$ for the chi-square comparison. The upper tail is the rejection region, so a large $Q$ provides evidence against the zero-autocorrelation null. Failing to reject means no detected residual serial correlation.
.
Worked example
You are given an estimated autoregressive model for monthly portfolio excess returns. The report supplies residual observations, sample residual autocorrelations through a stated maximum lag, and an upper-tail critical value. Your job is to calculate the Ljung-Box statistic at the stated significance level and decide whether the residuals still show serial correlation.
| Given | Value |
|---|---|
| Frequency | Monthly |
| Residual count, $n$ | 120 monthly residual observations |
| Estimated AR order, $p$ | 2 periods |
| Maximum residual lag, $m$ | 4 months |
| Sample residual autocorrelation, $\hat{\rho}_1$ | 0.08 |
| Sample residual autocorrelation, $\hat{\rho}_2$ | -0.05 |
| Sample residual autocorrelation, $\hat{\rho}_3$ | 0.12 |
| Sample residual autocorrelation, $\hat{\rho}_4$ | -0.03 |
| Significance level, $\alpha$ | 0.05 |
| Upper-tail critical value | 5.991 |
Monthly frequency gives each lag a month-sized step. The count $n$ is the number of residual observations used in the test. The chart keeps the sample correlations near zero over the tested lags, but the test combines all of them rather than judging the chart by eye.
Loading diagramβ¦
Now follow the finite-sample calculation schedule. At lag $k$, the denominator is $n-k$, and the last column supplies the lag contribution before the common Ljung-Box scaling. Match each row to the same lag in the chart: square its sample autocorrelation, then divide by that rowβs denominator. This keeps negative correlations from offsetting positive ones. Add the four contributions before applying the common sample-size factor; the schedule organizes the calculation, while the final comparison still uses the upper-tail critical value.
| Lag | $n-k$ | Term |
|---|---|---|
| 1 | 119.00 | 0.0001 |
| 2 | 118.00 | -0.0000 |
| 3 | 117.00 | 0.0001 |
| 4 | 116.00 | -0.0000 |
Read the two entries shown as $-0.0000$ as zero in this schedule.
- Apply the $n-k$ denominator at each lag. You are correcting for the observations lost at that lag, which produces the entries in the schedule.
- Subtract the estimated AR order from the maximum tested lag. The chi-square degrees of freedom are $m-p=4-2=2.00$.
- Substitute the sample count and corrected lag terms into the Ljung-Box formula. Retaining calculation precision produces $Q(4)=2.1655$.
- Use the upper-tail rule at $\alpha=0.05$. The statistic minus the critical value is $2.1655-5.991=-3.8255$, so the rejection condition is not met.
At $\alpha=0.05$, you fail to reject $H_0$ and find no detected residual serial correlation. That supports, but does not prove, an adequate AR fit.
Changed condition
Keep the same monthly model and all of its reported test inputs. Only the sample residual autocorrelation at the selected lag changes, and the question asks whether the conclusion changes.
| Quantity | Base | Changed |
|---|---|---|
| $\hat{\rho}_3$ | 0.12 | 0.3 |
| $Q(4)$ | 2.1655 | 11.6251 |
| $Q(4)-5.991$ | -3.8255 | 5.6341 |
Predict the direction before looking at the changed column. The larger absolute residual autocorrelation contributes more after squaring, so $Q$ rises and crosses the unchanged upper-tail critical value. You reject $H_0$ and conclude that the model leaves detected residual serial correlation, so it does not pass this residual-fit diagnostic. Before reading on, calculate the changed lag contribution and the new $Q(4)$ yourself.
Common error
You may reject when $Q$ is below the critical value if you mistake the statistic for a lower-tail fit measure. That feels right because small residual correlations look like a small test result. But the test statistic $Q$ is nonnegative, and the chi-square calculation accumulates squared correlations. The upper-tail decision exposes the mistake: you reject the zero-autocorrelation null only when $Q$ is sufficiently large. A smaller $Q$ means you fail to reject it.
Check yourself
Practice
A portfolio manager estimates an AR(2) model from 120 monthly residual observations. The sample residual autocorrelations through lag 4 are 0.08, -0.05, 0.12, and -0.03. The significance level is 0.05 and the upper-tail critical value is 5.991.
Question 1
Calculate the Ljung-Box statistic for the vignette. Which value is correct?
Question 2
Which hypotheses match the Ljung-Box test through lag 4?
Question 3
At significance level 0.05, which conclusion follows for the base case with critical value 5.991?
Question 4
Which changed condition produces rejection of the residual-autocorrelation test?
For an estimated AR(2) model tested through lag 4, which chi-square degrees of freedom should be used?
Revision snapshot
Residual autocorrelations near zero across tested lags support, but do not prove, an adequate AR fit. The Ljung-Box statistic turns those residual correlations into the test statistic shown below.
$$ Q(m)=n(n+2)\sum_{k=1}^{m}\frac{\hat{\rho}_k^2}{n-k} $$
For an estimated $AR(p)$, compare $Q$ with a chi-square critical value using approximately $m-p$ degrees of freedom. A large $Q$ points to the upper tail and evidence against the null of zero autocorrelation. If you fail to reject, you found no detected residual serial correlation, not proof that none exists. On the exam, state the hypotheses, use the sample residual count and autocorrelations, calculate or interpret $Q$, and apply the upper-tail critical value. Do not reject when $Q$ is below that critical value.
Unlock the full lesson and continue reading
Signup to continue reading this lesson and unlimited access questions, flashcards, AI notes, and more