Latticework

Command Palette

Search for a command to run...

Time Series

ARIMA Intuition

18 min

Explanation

ARIMA (AutoRegressive Integrated Moving Average) is the classic time-series forecasting model, built from three pieces: AR (autoregressive — the value depends on its own past values, exactly the relationship the Autocorrelation module measures), I (integrated — how many times you difference the series to make it stationary, from the Stationarity module), and MA (moving average — the value depends on past FORECAST ERRORS, not covered here).

The simplest AR model, AR(1), predicts the next value from just the previous one:

def ar1_forecast(x_prev, phi, c):
    return c + phi * x_prev

print(ar1_forecast(10, 0.5, 2))   # 7.0
Try it

phi controls how much the series 'remembers' its previous value -- phi=0.5 means each step is half of the last (decaying toward 0), phi=1 means the series never moves at all with c=0 (or drifts linearly with c != 0 -- that's a random walk with drift).

Loading editor…
Explanation

Whether phi is less than 1 in absolute value determines the whole character of the series:

  • |phi| < 1: stable — the series reverts toward a long-run equilibrium value (c / (1 - phi)), regardless of starting point.
  • phi = 1: a random walk — no reversion at all, drifts forever (this is exactly the random walk from the Stochastic Processes course).
  • |phi| > 1: explosive — deviations grow without bound.

Real ARIMA fitting estimates phi (and the MA/differencing parameters) from historical data via maximum likelihood — a genuinely involved optimization problem, well beyond what's practical to hand-implement. Understanding what phi MEANS, and why its magnitude matters, is the conceptual foundation that makes the fitted model's output interpretable once you do reach for a real ARIMA library.

Exercise

Write `ar1_forecast(x_prev, phi, c)`: one step of an AR(1) model — return `c + phi * x_prev`.

Exercise

Write `ar1_simulate(x0, phi, c, n)`: simulate `n` steps of the AR(1) process starting from `x0`, returning the full list of `n + 1` values (including `x0`).

Quiz

In an AR(1) model x_t = c + phi·x_(t-1), what determines whether the series is stable (mean-reverting) or explosive over time?

Checkpoint

You understand what ARIMA's AR component does, can simulate a simple AR(1) process, and know how phi's magnitude determines whether the series is stable, a random walk, or explosive.