Seasonal Lag
A lag is a past value of a series used as a predictor of the present one: \(y_{t-1}\), \(y_{t-2}\) and so on. A seasonal lag is the one equal to the length of the seasonal period. If the pattern repeats every \(m\) steps, the seasonal lag is \(y_{t-m}\) โ the value from the same point in the previous cycle.
| Data | Seasonal period \(m\) | Seasonal lag | Meaning |
|---|---|---|---|
| Monthly, yearly pattern | 12 | \(y_{t-12}\) | The same month last year |
| Daily, weekly pattern | 7 | \(y_{t-7}\) | The same weekday last week |
| Quarterly, yearly pattern | 4 | \(y_{t-4}\) | The same quarter last year |
| Hourly, daily pattern | 24 | \(y_{t-24}\) | The same hour yesterday |
The idea is the one behind the seasonal naรฏve forecast, which sets each forecast “equal to the last observed value from the same season” โ formally \(\hat{y}_{T+h|T} = y_{T+h-m(k+1)}\), where \(k\) is the integer part of \((h-1)/m\), so the forecast steps back an appropriate number of whole periods as the horizon lengthens.
What it looks like in the ACF
The autocorrelation function makes seasonal lags visible: “when data are seasonal, the autocorrelations will be larger for the seasonal lags (at multiples of the seasonal period).” The series below is synthetic โ six years of monthly data with a rising trend, a fixed twelve-month pattern and noise.
import numpy as np
def monthly_series(years=6, seed=12):
"""Monthly data with a rising trend, a fixed 12-month seasonal pattern, and noise."""
rng = np.random.default_rng(seed)
t = np.arange(12 * years)
season = 20 * np.sin(2 * np.pi * t / 12)
return 100 + 0.5 * t + season + rng.normal(0, 5, t.size)
def acf(y, max_lag):
y = y - y.mean()
denominator = (y ** 2).sum()
return [float((y[k:] * y[:len(y) - k]).sum() / denominator) for k in range(1, max_lag + 1)]
y = monthly_series()
raw = acf(y, 24)
# First differencing strips the trend, leaving the seasonal pattern on its own.
detrended = acf(np.diff(y), 24)
for lag in (1, 6, 11, 12, 13, 24):
print(f"{lag:>2} {raw[lag - 1]:+.3f} {detrended[lag - 1]:+.3f}")
# 1 +0.843 +0.337
# 6 -0.329 -0.549
# 11 +0.614 +0.460
# 12 +0.677 +0.529
# 13 +0.582 +0.449
# 24 +0.416 +0.444
seasonal_difference = y[12:] - y[:-12]
print(f"{len(y)} {len(seasonal_difference)} {y.std():.2f} {seasonal_difference.std():.2f}")
# 72 60 17.36 7.07
observations_per_month = len(y) // 12
# Six years of monthly data hold only six Januaries.
print(f"{len(y)} {observations_per_month}")
# 72 6
| Lag | ACF of the series | ACF after first differencing |
|---|---|---|
| 1 | +0.843 | +0.337 |
| 6 | -0.329 | -0.549 |
| 11 | +0.614 | +0.460 |
| 12 | +0.677 | +0.529 |
| 13 | +0.582 | +0.449 |
| 24 | +0.416 | +0.444 |
In the first column lag 12 is a local peak, higher than its neighbors at 11 and 13, sitting on a slow decay that the trend produces โ the combination that gives a seasonal series with a trend its characteristic scalloped autocorrelation. First differencing removes the trend and the lag-1 value falls from +0.843 to +0.337, while lag 12 remains the local maximum. A peak at multiples of some number is how an unknown seasonal period gets identified when the calendar does not make it obvious.
Differencing at the seasonal lag
Subtracting the value one season earlier, \(y_t - y_{t-m}\), is seasonal differencing. On the series above it cuts the standard deviation from 17.36 to 7.07, because it removes two things at once: the seasonal pattern, and any trend that is roughly linear over one period โ the same amount of growth is subtracted from every point.
This is the operation behind the seasonal differencing order in a seasonal ARIMA model, and the usual caution applies: each seasonal difference costs \(m\) observations from the start of the series, and differencing more than necessary adds variance rather than removing structure. The stationarity diagnostics that decide how much to difference are covered under ARIMA.
Seasonal lags are expensive
A lag-1 feature is nearly free: a series of length \(T\) supplies \(T-1\) usable rows. A lag-12 feature costs twelve, and a lag-24 feature costs twenty-four. On short series that is a material fraction of the data.
The deeper cost is subtler and rarely stated. The seasonal effect for a given month is informed by the observations of that month, and those accumulate once a year. Six years of monthly data is seventy-two observations, which sounds comfortable โ but it contains exactly six Januaries. Estimating twelve monthly effects from six repetitions each is why seasonal components are noisy, why they are usually smoothed or constrained rather than estimated freely, and why Fourier terms with a small number of harmonics often beat a free parameter per period.
It also means a single seasonal-lag feature carries a single past observation, with whatever noise or one-off event that month contained. Last July’s figure as a predictor of this July is one draw, not an average โ which is what separates using the seasonal lag as a feature from estimating a seasonal component.
Where it gets used
- Seasonal ARIMA. Seasonal autoregressive and moving-average terms operate at the seasonal lag and its multiples, alongside the non-seasonal terms at short lags.
- Exponential smoothing. The seasonal component is updated once per period, using the estimate from one season ago.
- Feature-based machine learning. Tree models and regressions see no time structure at all unless it is engineered, so \(y_{t-m}\), \(y_{t-2m}\) and rolling aggregates over past seasons are the standard way to supply it โ see time series forecasting.
- As a benchmark. Using the seasonal lag directly is the seasonal naรฏve forecast, and beating it is the minimum bar for a seasonal model.
Two complications are worth naming. A series can have more than one seasonal period โ daily data usually has both a weekly and an annual pattern โ so there is more than one seasonal lag, and they are not multiples of each other. And an annual pattern in daily data has a period of about 365.25 rather than an integer, so a fixed integer lag drifts against the calendar over a few years; Fourier terms on the calendar date handle that where an integer lag cannot. The pattern itself is the subject of seasonality.
References
- Rob J. Hyndman and George Athanasopoulos, Forecasting: Principles and Practice (3rd edition), section 5.2 Some simple forecasting methods, OTexts
- Rob J. Hyndman and George Athanasopoulos, Forecasting: Principles and Practice (3rd edition), section 2.8 Autocorrelation, OTexts
- Rob J. Hyndman and George Athanasopoulos, Forecasting: Principles and Practice (3rd edition), section 2.3 Time series patterns, OTexts
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
