A time series is stationary if its statistical properties (mean, variance, autocorrelation structure) don't change over time. Many classical time series methods assume stationarity. Real-world series usually aren't — knowing how to test and transform is part of the job.
Strict vs weak stationarity
- Strict: joint distribution is invariant under time shifts
- Weak / covariance stationarity: mean and variance are constant, autocovariance depends only on lag
Most "stationarity" tests check weak stationarity, which is enough for ARMA-family models.
Visual diagnostics
Plot the series. If you see a clear trend (slope), seasonal pattern, or expanding variance, it's not stationary. Plot the rolling mean and rolling standard deviation — they should be roughly flat for a stationary series.
Statistical tests
- Augmented Dickey-Fuller (ADF): null = unit root (non-stationary). Small rejects null → series is stationary.
- KPSS: null = stationary. Small rejects null → not stationary. Run both — they should agree, and disagreement is informative.
Transforming to stationarity
- Differencing: . Removes linear trends. Twice-differenced removes quadratic. Most economic series need first-differencing.
- Log transform: stabilizes multiplicative variance.
- Seasonal differencing: for period . Removes seasonal patterns.
- Detrending: subtract a fitted trend (linear, polynomial, or HP filter).
ARIMA notation
ARIMA(p, d, q) means: AR order p, differencing order d, MA order q. The 'I' (integrated) is the differencing. Picking based on stationarity tests is the first step in ARIMA modeling.
Why it matters
If you fit a regression to a non-stationary series, you can get "spurious regressions" — high between two unrelated series simply because both trend. Always check stationarity before applying methods that assume it. Modern alternatives (Prophet, neural network forecasters) are more forgiving but still benefit from understanding the underlying structure.