Notes

Stationarity

Some data changes because the world is changing (like inflation pushing prices up). Other data “wiggles” around a stable pattern (like daily temperature around a seasonal average). Stationarity is the idea of telling those two situations apart in a time series.

What stationarity means

A time series is stationary if its statistical behavior stays the same over time. In practice, this usually means:

  • The mean is constant (no persistent upward/downward drift).
  • The variance is constant (the size of fluctuations doesn’t steadily grow or shrink).
  • The autocovariance depends only on the lag (how far apart points are), not on the calendar time.

This common version is called weak (covariance) stationarity. A stricter version, strict stationarity, requires the entire distribution to be unchanged over time, which is stronger than most ML workflows need.

Intuition: “same rules tomorrow”

Think of stationarity as: the process follows the same rules today and next month. If the rules change—because of trend, seasonality, policy changes, or a shock—the series is non-stationary.

Examples you’ll recognize

  • House prices: often non-stationary due to long-term trend; price changes (returns) may be closer to stationary.
  • Electricity demand: non-stationary because of daily/weekly seasonality; after removing seasonality, residuals may be stationary.
  • Sensor noise: often approximately stationary around a fixed level.

Why it matters in AI/ML

Many classic forecasting models (like ARMA/ARIMA) assume stationarity; if it’s violated, you can get unstable parameters and misleading uncertainty. Even in modern ML, non-stationarity shows up as distribution shift, causing models trained on past data to degrade. Common fixes include differencing, detrending, seasonal adjustment, and checking with tests like ADF or KPSS.

Stationarity is the property of a time series whose statistical behavior does not change over time—typically meaning constant mean and variance, and autocovariances that depend only on the lag, not the calendar time. It matters because many forecasting and inference methods (e.g., ARMA models) assume stationarity for valid parameter estimation and uncertainty quantification. Example: differencing a trending series can make it approximately stationary before fitting an ARIMA model.

Imagine you run a small café and track how many customers you get each day. If your business is steady, the ups and downs look similar from month to month: some busy days, some quiet days, but no long-term drift upward or downward. That “steady behavior” is the idea behind stationarity.

In time-based data (called a time series), stationarity means the data’s basic pattern stays consistent over time—its typical level and how much it wiggles around don’t keep changing. Many forecasting methods in statistics and machine learning work better when the data is stationary, because the past behaves like the future in a predictable way.