A lag is the distance between a time-series observation and an earlier observation. At lag k, the comparison is between the value at time t and the value at time t − k. Lags let a forecasting model use past values to help predict a current value; in an AR(1) model, that past value is the immediately preceding observation. section 7.3.7 section 7.3.1
Inspect lag relationships before choosing how many past values to model:
- The autocorrelation function (ACF) measures correlation between a series and its past values across lags. Plotting those correlations reveals temporal dependence. section 7.3.7
- The partial autocorrelation function (PACF) measures the relationship at a particular lag after accounting for intervening lags. A sharp drop after the first few lags can suggest that only those lags have a substantial direct relationship. section 7.3.7
- Stationarity matters when interpreting these patterns: a stationary series has autocovariance that depends on the lag, not on the particular dates compared. Differencing subtracts the previous observation to help address nonstationarity. section 7.3.5 section 7.3.7
Inspect lags before fitting ARIMA
For a training series of closing prices, `plot_acf(train)` and `plot_pacf(train)` expose lag relationships. After `train_diff = train.diff().dropna()`, compare the original and differenced plots rather than assuming their patterns are unchanged. In this example, the augmented Dickey–Fuller p-value falls from about 0.576 for the original training series to 1.25 × 10⁻¹⁶ after differencing. The resulting specification, `ARIMA(train, order=(1, 1, 0))`, uses one autoregressive lag, one differencing step, and no lagged forecast errors. These settings follow the inspected training data; they are not a universal choice. section 7.3.7 section 7.3.9
A lag can describe either a past observation or, in a moving-average model component, a past forecast error. ARIMA can use both; exponential smoothing instead forecasts with weighted past observations whose weights decrease exponentially. Distinguish these roles before interpreting a model’s order. section 7.3.9 section 7.4.3




