ML Systems Lab Open interactive version →
Intermediate 45 min read ARIMASARIMAACFPACFBox-Jenkins

ARIMA Family

AR/MA intuition, ACF/PACF identification, SARIMA, Box-Jenkins, structural break failure

Monthly airline passenger counts tell a story that breaks every naive forecasting approach. The Box-Jenkins 1976 dataset shows a clear upward trend plus strong yearly seasonality — summer peaks, winter troughs — with amplitude that grows as the level grows. A straight regression on time misses the seasonality. A seasonal average ignores the trend. Feed the raw series into a model without preprocessing and the non-stationary mean will invalidate every coefficient estimate.

ARIMA is built to handle exactly this. The "I" — integrated — is the trend fix: difference the series once (y_t − y_{t-1}) and the linear trend disappears, leaving a stationary series the AR and MA components can model. AR(p) captures autocorrelation through the series' own past: the current value is a weighted sum of the last p observations. MA(q) captures dependence on past shock terms. Together they describe how today's value relates to yesterday's observations and yesterday's surprises.

For the airline data, the seasonal structure at period s=12 requires SARIMA: seasonal AR(P) at lags 12, 24, 36; seasonal differencing at lag 12 to remove the repeating yearly cycle; seasonal MA(Q) for dependence on past seasonal shocks. The SARIMA(p,d,q)(P,D,Q)[12] notation stacks non-seasonal and seasonal layers into one model.

NOT this. "ARIMA is outdated and should always be replaced by ML methods." ARIMA is interpretable, requires no GPU, handles small datasets (n < 200) well, and its parameters have direct statistical interpretations: φ₁ is the momentum coefficient, θ₁ is the shock decay rate. For monthly aggregate forecasting with fewer than 5 years of data, ARIMA is often competitive with or better than neural methods. The real limitation is the Box-Jenkins identification workflow: ACF/PACF cutoffs appear cleanly only in simulated data. Real series mix AR and MA contributions, making the cutoffs ambiguous. The workflow is iterative — tentatively identify orders, fit, diagnose residuals, revise — and it breaks at scale. At 50,000 SKUs, per-series ARIMA identification is impractical regardless of accuracy.

Key points

Takeaway

ARIMA's "I" solves non-stationarity by differencing — one difference removes a linear trend, enabling the AR and MA components to model the stationary residuals. ACF/PACF cutoffs are a starting point, not a recipe: textbook-clean patterns only appear in simulated data, so Box-Jenkins is always iterative via residual diagnostics. The most consequential failure mode is the structural break: after a regime change the model absorbs the shift as a spurious long-lag effect, producing biased forecasts indefinitely — the fix is re-identifying orders on post-break data, not adding more lags.

Recap

Check your understanding

Q1. Your ACF shows significant spikes at lags 1, 2, 3 that decay, and your PACF shows a single significant spike at lag 1 that cuts off. What model do you fit and why?

Q2. You fit ARIMA(2,1,2) to a monthly sales series; Ljung-Box on residuals passes overall (p=0.42) but the residual ACF shows a spike at lag 12. Which TWO statements are correct?

Q3. Your e-commerce platform has 50,000 product SKUs. You need daily sales forecasts for each. Why is per-SKU ARIMA unrealistic and what do you use instead?

Q4. You fit ARIMA(0,1,1) and ARIMA(1,1,0) to the same series. Both pass diagnostics. The MA model has lower AIC. A colleague argues the AR model is more interpretable for business stakeholders. How do you decide?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →