Patterns › Time series

ACF / PACF + Ljung-Box

Autocorrelation (ACF) and partial autocorrelation (PACF) plots of a time series + Ljung-Box tests at canonical lags. The diagnostic before ARIMA modelling.

What is ACF / PACF + Ljung-Box?

ACF at lag k = correlation(x_t, x_{t-k}); PACF at lag k = the same correlation after partialling out the intermediate lags. The two together identify the (p, q) structure of an ARMA model: ACF cuts off at lag q for an MA(q); PACF cuts off at lag p for an AR(p); both decay gradually for a mixed ARMA.

The ±1.96/√n band approximates the 95% no-correlation interval. Bars outside the band at low lags suggest serial dependence worth modelling.

Ljung-Box aggregates multiple lags into one χ²-style test — a significant Ljung-Box at the standard lags 5 / 10 / 20 confirms the series isn't white noise.

When should I use ACF / PACF + Ljung-Box?

  • ARIMA model identification (the Box-Jenkins approach).
  • Checking residuals of any time-series model to confirm they're white noise.

What data does it need?

One numeric column ordered in time + max lag.

What does it report?

Lag-by-lag ACF and PACF with the ±1.96/√n band, Ljung-Box χ² and p at lags 5 / 10 / 20.

What does it assume?

  • Series is approximately stationary (mean / variance don't drift) — difference first if not.
  • Equally spaced observations.

How do I interpret the result?

ACF decays exponentially while PACF cuts off at lag p ⇒ AR(p).

ACF cuts off at lag q while PACF decays exponentially ⇒ MA(q).

Both decay gradually ⇒ mixed ARMA; pick orders via AIC after fitting candidates.

See also

References

  • Box & Jenkins (1970). Time Series Analysis: Forecasting and Control.