Assumption · Statistics Library

No (residual) autocorrelation

No autocorrelation means that consecutive residuals, ordered by time or by whatever sequence the data were collected in, are not systematically related to each other.

Topic indexA reference reading outside the guided chapter sequence

Understand the idea

Many models assume each row's leftover error is independent noise. If the errors instead drift together (a high error today is usually followed by another high error tomorrow), the model is not capturing something structural about how the data unfold over time.

This most often shows up in time-ordered data: a regression predicting monthly sales from advertising spend, where the residuals for adjacent months tend to move together because of something the model left out (a slow trend, a competitor's price change). The residual plot against time, or its autocorrelation function, is the diagnostic: a random scatter is what independence should look like; a smooth wave or a run of same-signed residuals is the tell.

The consequence is the same as any independence violation: reported standard errors are too small, so p-values look more convincing and confidence intervals look tighter than the data actually support.

Autocorrelation is also called serial correlation, because it is correlation between neighboring values in a series. The Durbin-Watson test checks for autocorrelation between each residual and the next one; a value near 2 means no such correlation, and values well below 2 point to positive autocorrelation. The Ljung-Box test checks several steps back at once, asking whether residuals are correlated with the values 1, 2, 3 or more positions earlier.

Practitioner explanation

Two standard diagnostics serve different settings. The Durbin-Watson statistic (range 0 to 4, 2 indicates no first-order autocorrelation, well below 2 indicates positive autocorrelation) is the classical check for regression residuals ordered by time or space. The Ljung-Box test checks a whole set of lags at once and is the standard residual diagnostic after fitting an ARIMA model, where remaining structure in the residuals means the model has not fully captured the series' dependence.

Autocorrelated residuals leave point estimates unbiased in the usual OLS case but invalidate the classical standard errors; Newey-West (HAC) standard errors or an explicit time-series model (adding lagged terms, or moving to ARIMA) are the standard responses, not a transformation of the outcome variable.

KernelStats computes the Durbin-Watson statistic automatically as a regression diagnostic on the linear-regression card, and the Ljung-Box test automatically on ARIMA residuals; neither is presented as a hard gate, both are diagnostics the analyst is expected to read alongside the residual plot.

When to use it

Consider it when

Check it whenever rows have a natural order (time, spatial position, measurement sequence): the situation independence violations are most likely to hide in.

Use caution when

Do not run it on data with no meaningful row order (a cross-section of unrelated individuals); autocorrelation is only defined relative to an ordering, and testing an arbitrary order is meaningless.

Formulas and symbols

Ljung-Box statistic

Q=n(n+2)∑k=1hρ^k2n−kQ = n(n+2) \sum_{k=1}^{h} \frac{\hat{\rho}_k^2}{n-k}

rho-hat_k is the sample autocorrelation at lag k, over h lags tested; large Q (small p) indicates remaining autocorrelation in the residuals.

Durbin-Watson statistic

DW=∑t=2n(et−et−1)2∑t=1net2DW = \frac{\sum_{t=2}^{n} (e_t - e_{t-1})^2}{\sum_{t=1}^{n} e_t^2}

e_t are the regression residuals in their natural (usually time) order. DW near 2 indicates no first-order autocorrelation.

Alternatives

  • ARIMA Forecast. Residuals from a plain regression on a time-ordered outcome show autocorrelation; modeling the time-series structure directly is usually better than patching the standard errors.
  • Linear Mixed-Effects Model. The dependence comes from repeated measurements of the same units rather than a single time axis; a random effect per unit models that structure directly.

Common misconceptions

Misconception

A high R-squared time-series regression cannot have an autocorrelation problem.

Correction

Two independently trending or seasonal series can produce a high R-squared and a strongly autocorrelated, structurally meaningless residual (a 'spurious regression'). Always check the residual autocorrelation on a time-series regression regardless of R-squared.

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §8.1.1.5 Are the observations independent?, NIST/SEMATECH (2012), §8.1.1.