Stationarity, Differencing and Unit Roots
A stationary series has stable statistical properties over time. Learn why prices are non stationary, how to test with ADF and KPSS and how to make data stationary.
A time series is stationary if its statistical properties, such as its mean, variance and autocorrelation, do not change over time. Stationarity matters because most statistical methods assume it: if the average and volatility of a series keep shifting, relationships estimated in the past may not hold in the future. Prices are almost never stationary; returns are much closer. Many trading strategies, especially mean reversion and pairs trading, depend on finding series that really are stationary.
Types of stationarity#
| Type | Definition |
|---|---|
| Strict stationarity | The full probability distribution does not change over time |
| Weak (covariance) stationarity | The mean, variance and autocovariances are constant over time |
In practice, "stationary" usually means weakly stationary.
Stationary vs non stationary#
| Series | Typically stationary? | Why |
|---|---|---|
| Stock prices | No | They trend and wander like a random walk |
| Returns | Approximately | Mean and variance are more stable, though volatility clusters |
| Spread between cointegrated assets | Yes (if truly cointegrated) | Pulled back to an equilibrium. See Cointegration |
| Interest rates | Debated | Very persistent; behaviour depends on the period |
| Volatility | Approximately, with mean reversion | Tends to return to long run levels |
Unit roots#
A random walk has a "unit root": shocks have a permanent effect, and the series does not return to a fixed mean. Many price series behave as if they have a unit root. Differencing them (taking changes) removes the unit root and produces a stationary series. See White Noise and Random Walks.
random walk: P_t = P_(t-1) + ε_t (non stationary)
first difference: ΔP_t = P_t - P_(t-1) = ε_t (stationary)
Testing for stationarity#
| Test | Null hypothesis | Interpretation |
|---|---|---|
| Augmented Dickey Fuller (ADF) | Series has a unit root (non stationary) | Rejecting the null suggests stationarity |
| Phillips Perron | Unit root | Similar to ADF, robust to some autocorrelation |
| KPSS | Series is stationary | Rejecting the null suggests non stationarity |
Using ADF and KPSS together gives a clearer picture, since they have opposite null hypotheses.
Half life of mean reversion#
For a stationary, mean reverting series modelled as AR(1), the half life estimates how long a deviation takes to shrink by half:
half life = -ln(2) / ln(φ)
where φ is the AR(1) coefficient. For φ = 0.94 per day, the half life is about 11 days. See Mean Reversion and ARIMA.
Making data stationary#
| Method | Use |
|---|---|
| Differencing | Turn prices into changes |
| Log returns | Turn prices into percentage like changes. See Lognormal Distribution |
| Detrending | Remove a fitted trend |
| Seasonal differencing | Remove calendar patterns |
| Volatility scaling | Divide returns by recent volatility to stabilise variance |
Why stationarity matters for traders#
- Spurious regressions: regressing non stationary series on each other produces false relationships. See Regression Analysis.
- Mean reversion strategies only work on series that actually revert.
- Machine learning features built from non stationary data can fail out of sample. See Feature Engineering.
- Regime changes break stationarity even in returns. See Structural Breaks and Regime Changes.
Frequently asked questions#
What does stationary mean in time series?#
That the series' statistical properties, such as its mean, variance and autocorrelation, stay constant over time.
Are stock prices stationary?#
No. Prices trend and wander, behaving like a random walk; returns are much closer to stationary.
How do you test for stationarity?#
With tests such as the Augmented Dickey Fuller (ADF) test, the Phillips Perron test and the KPSS test.
Next, learn how two non stationary series can stay together in Cointegration.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Percentiles, Quantiles and Z-ScoresMath and Statistics
- Regression AnalysisMath and Statistics
- Autocorrelation and Partial AutocorrelationMath and Statistics
- Granger CausalityMath and Statistics
- ARIMAMath and Statistics
- EconometricsMath and Statistics