Why Diagnose ARIMA Residuals?
Choosing an ARIMA specification is not the end of model assessment. After fitting a candidate, inspect what remains in its residuals. If those residuals retain a systematic pattern—especially serial dependence—the model has left some time-related structure unexplained. That can undermine its usefulness for forecasting, even if its fit statistics compare favorably with those of other candidates.
Residual diagnostics are evidence, not a guarantee. A residual plot or test that shows no clear dependence does not prove that a model is correct; it indicates only that the diagnostic has not detected the pattern it was designed to find. A full assessment uses more than one diagnostic and considers its limitations.
The diagnostic target is the model’s innovations, but in practice analysts inspect estimated residuals, which depend on fitted parameters and may have extra finite-sample structure. The usual plots and tests are therefore approximate tools. They are most informative when interpreted together with the model specification, sample size, and forecasting purpose.
Time Plots and Residual ACFs
A residual time plot shows \(e_t\) in observation order. Look for a nonzero level, a trend, changing spread, long runs of positive or negative values, cycles, or isolated unusual observations. Runs and cycles can signal dependence; a fan-shaped change in spread suggests nonconstant variance. These visual patterns are prompts for investigation, not formal tests.
The residual autocorrelation at lag \(k\) measures linear association between residuals \(k\) time steps apart. A common sample estimate, with \(\bar e\) the residual mean and \(n\) residuals, is
Under a white-noise approximation, individual sample autocorrelations have standard error about \(1/\sqrt{n}\). Thus, approximate pointwise 95% reference limits are
These are approximate, pointwise limits: they do not control the chance of seeing at least one apparent exceedance across many lags. In addition, parameter estimation affects the residual ACF. A single bar outside the limits is a reason to look more closely, not by itself decisive proof of model failure. Several large bars, a sustained pattern, or a significant joint test provide stronger evidence of remaining dependence.
Worked Example: Reading a Residual ACF With Pointwise Limits
A hypothetical monthly series has \(n=100\) fitted ARIMA residuals. The residual time plot fluctuates around zero without a visible trend or change in spread. The sample residual autocorrelations at lags 1 through 4 are \(0.18,-0.09,0.21,0.08\). Use approximate 95% pointwise limits to assess the pattern.
Step 1: Calculate the limits. The standard error approximation is \(1/\sqrt{100}=0.10\), so the limits are \(1.96(0.10)=0.196\) and \(-0.196\).
Step 2: Compare each autocorrelation with the limits. At lag 1, \(0.18\) is within the limits. At lag 2, \(-0.09\) is within them. At lag 3, \(0.21>0.196\), so that bar is just outside the upper limit. At lag 4, \(0.08\) is within the limits.
Conclusion. The plot and ACF do not show a broad or sustained pattern, but lag 3 merits attention. One marginal pointwise exceedance is not enough to conclude that the ARIMA model is inadequate. A joint portmanteau test and the wider diagnostic context are useful next checks. This method avoids treating a pointwise ACF limit as a simultaneous test of all lags.
Portmanteau Tests for Several Lags
A portmanteau test asks whether a group of residual autocorrelations, from lag 1 through lag \(h\), are jointly zero. The Box–Pierce statistic is \(Q_{\mathrm{BP}}=n\sum_{k=1}^{h}\hat{\rho}_k^2\). A commonly used finite-sample adjustment is the Ljung–Box statistic:
Under the null hypothesis that the residual autocorrelations through lag \(h\) are zero, the statistic is approximately chi-square distributed. For a fitted nonseasonal ARIMA model, a common reference distribution has \(h-(p+q)\) degrees of freedom. For a seasonal ARIMA model, a common adjustment is \(h-(p+q+P+Q)\), where \(p,q\) are the nonseasonal AR and MA orders and \(P,Q\) are the seasonal AR and MA orders.
The reason for the reference distribution is that, under white noise and for a sufficiently large sample, each \(\hat{\rho}_k\) is approximately centered at zero with variance about \(1/n\). Consequently, \(\sqrt{n}\hat{\rho}_k\) is approximately standard normal. If these quantities are treated as approximately independent across the selected lags, the sum of their squares behaves approximately like a chi-square variable. Fitting AR and MA parameters uses information that would otherwise be available for testing, which motivates reducing the degrees of freedom. The Ljung–Box factors \(n(n+2)/(n-k)\) adjust the basic Box–Pierce weighting for finite-sample behavior; they do not make the approximation exact.
A large statistic relative to its reference distribution, or a small p-value, is evidence against the null of no autocorrelation through lag \(h\). It does not identify the cause of the dependence. A nonsignificant result means the test did not find sufficient evidence against the null; it does not establish that every residual property is satisfactory.
Worked Example: Calculating a Ljung–Box Statistic
A hypothetical fitted ARIMA model has \(n=90\) residuals. The sample residual autocorrelations at lags 1, 2, and 3 are \(0.10,-0.20,0.15\). The fitted model has \(p=1\), \(q=0\), and \(d=1\). Calculate the Ljung–Box statistic through lag \(h=3\), and test at the 5% level using the common degrees-of-freedom adjustment.
Step 1: Square the autocorrelations. The squared values are \(0.10^2=0.0100\), \((-0.20)^2=0.0400\), and \(0.15^2=0.0225\).
Step 2: Apply the lag-specific denominators. The three terms are \(0.0100/89=0.00011236\), \(0.0400/88=0.00045455\), and \(0.0225/87=0.00025862\). Their sum is approximately \(0.00082553\).
Step 3: Multiply by the Ljung–Box factor. Here, \(n(n+2)=90(92)=8{,}280\). Thus,
Step 4: Choose the reference distribution and decide. The degrees of freedom are \(h-(p+q)=3-(1+0)=2\); \(d=1\) is not subtracted under the stated convention. The 5% upper critical value for \(\chi^2_2\) is approximately \(5.991\). Since \(6.835>5.991\), reject the null at the 5% level. This is evidence of residual autocorrelation among the first three lags. The calculation avoids both an arithmetic error in the weighted sum and the mistake of subtracting the differencing order.
Check: Each squared autocorrelation is nonnegative, so the statistic must be nonnegative. The value \(6.835\) is also larger than the Box–Pierce value \(90(0.0100+0.0400+0.0225)=6.525\), as expected here from the Ljung–Box finite-sample adjustment.
Worked Example: Seasonal ARIMA Degrees of Freedom
A hypothetical monthly series is fitted with a seasonal ARIMA model having \(p=1,q=1,P=1,Q=0\), with seasonal period 12. A Ljung–Box statistic calculated through lag \(h=12\) is \(19.0\). Using the common seasonal adjustment, decide whether the statistic is significant at the 5% level.
Step 1: Count the fitted AR and MA orders. The total is \(p+q+P+Q=1+1+1+0=3\).
Step 2: Calculate the degrees of freedom. They are \(h-(p+q+P+Q)=12-3=9\). Neither differencing order is part of this subtraction.
Step 3: Compare with the critical value. The 5% upper critical value for \(\chi^2_9\) is approximately \(16.919\). Since \(19.0>16.919\), reject the null at the 5% level. There is evidence of remaining autocorrelation among the first 12 residual lags. This conclusion uses the stated seasonal adjustment; it does not imply that every software implementation uses precisely the same convention.
Putting the Diagnostics Together
No single residual diagnostic answers every question about model adequacy. A useful sequence is to inspect the residual time plot, examine the ACF for localized or repeated dependence, and use a portmanteau test to assess several lags jointly. Then interpret the results in light of the application and the limitations of the approximations.
| Diagnostic | What it can reveal | What it does not establish |
|---|---|---|
| Residual time plot | Visible trend, runs, cycles, changing spread, or unusual observations | That the residuals are uncorrelated just because no pattern is obvious |
| Residual ACF | Which lags have notable estimated linear association | That one pointwise exceedance alone proves model failure |
| Ljung–Box test | Joint evidence of autocorrelation through the selected lag \(h\) | That the model is correct when the test is nonsignificant, or why dependence remains when it rejects |
The portmanteau test concerns autocorrelation, not all possible forms of misspecification. Residuals can have little linear autocorrelation yet show changing variance, outliers, or non-normal behavior. Normality is not required merely to define the Ljung–Box statistic, although distributional assumptions may matter for other inferential tasks. Conversely, non-normal residuals do not by themselves establish residual autocorrelation.
Choosing \(h\) also matters. A very small \(h\) may miss dependence at later or seasonal lags; an excessively large \(h\) can include many noisy sample autocorrelations and weaken the usefulness of the approximation. Choose lags that reflect the data frequency and plausible dependence, and consider seasonal lags when the application calls for them. The residual ACF can help reveal where the remaining pattern lies, while the portmanteau test summarizes evidence through the chosen cutoff.
Common Mistakes
- Using the wrong degrees of freedom. Under the common convention, subtract the fitted AR and MA orders, including seasonal orders when applicable. Do not automatically subtract \(d\) or \(D\).
- Using a critical value for the wrong chi-square distribution. The critical value depends on the degrees of freedom. For 9 degrees of freedom, the 5% upper critical value is about \(16.919\), not \(21.0\).
- Miscomputing the Ljung–Box sum. Each squared autocorrelation has its own denominator \(n-k\); the terms must be added before multiplication by \(n(n+2)\). For the 90-residual example, this gives \(8{,}280(0.00082553)\approx6.835\), not \(6.173\).
- Treating a nonsignificant test as proof. It is a failure to reject the specified no-autocorrelation null, not proof that the residuals are independent or that the model is adequate in every respect.
- Overinterpreting ACF bands. The approximate limits are pointwise. Checking many lags increases the chance that one bar will cross a limit by chance.
This diagnostic workflow is aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.
Check Your Understanding
For each situation, identify the relevant diagnostic and give the stated decision or interpretation.
- A hypothetical series has \(n=64\) residuals, and the residual ACF at lag 2 is \(-0.26\). Calculate the approximate 95% pointwise limits and say whether this lag is outside them. (Answer: The limits are \(\pm1.96/8=\pm0.245\); \(-0.26\) is just outside the lower limit, which is a warning to investigate rather than standalone proof of model failure.)
- A fitted ARIMA(0,1,1) model has \(n=80\) residuals with \(\hat{\rho}_1=0.05\) and \(\hat{\rho}_2=-0.10\). Calculate \(Q_{\mathrm{LB}}\) through \(h=2\) and decide at 5% using the common adjustment. (Answer: \(Q_{\mathrm{LB}}=80(82)[0.0025/79+0.0100/78]\approx1.049\); df \(=2-1=1\), and \(1.049<3.841\), so do not reject.)
- A seasonal ARIMA model has \(p=2,q=1,P=0,Q=1\), and its Ljung–Box statistic through lag 10 is \(13.0\). Find the common reference degrees of freedom and decide at 5%. (Answer: df \(=10-(2+1+0+1)=6\); the 5% upper critical value is about \(12.592\), so reject because \(13.0>12.592\).)
- A residual time plot fluctuates around zero with roughly steady spread, but the ACF has several notable bars at seasonal lags. What should the analyst conclude from the plots, and what additional check is appropriate? (Answer: The seasonal bars suggest possible remaining dependence despite the unremarkable time plot; assess the relevant seasonal lags jointly with a portmanteau test and interpret it with the model and sample in mind.)
- A fitted ARIMA model’s Ljung–Box test through a chosen lag is not significant. A colleague says this proves the residuals are independent and normally distributed. Is that conclusion justified? (Answer: No. The test provides insufficient evidence of autocorrelation through the selected lag; it neither proves independence nor tests normality.)