TradeLabs AILearn

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.

Advanced3 min readUpdated 3 Oct 2026
Markdown
Lesson 34 of 46

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#

TypeDefinition
Strict stationarityThe full probability distribution does not change over time
Weak (covariance) stationarityThe mean, variance and autocovariances are constant over time

In practice, "stationary" usually means weakly stationary.

Stationary vs non stationary#

SeriesTypically stationary?Why
Stock pricesNoThey trend and wander like a random walk
ReturnsApproximatelyMean and variance are more stable, though volatility clusters
Spread between cointegrated assetsYes (if truly cointegrated)Pulled back to an equilibrium. See Cointegration
Interest ratesDebatedVery persistent; behaviour depends on the period
VolatilityApproximately, with mean reversionTends 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#

TestNull hypothesisInterpretation
Augmented Dickey Fuller (ADF)Series has a unit root (non stationary)Rejecting the null suggests stationarity
Phillips PerronUnit rootSimilar to ADF, robust to some autocorrelation
KPSSSeries is stationaryRejecting 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#

MethodUse
DifferencingTurn prices into changes
Log returnsTurn prices into percentage like changes. See Lognormal Distribution
DetrendingRemove a fitted trend
Seasonal differencingRemove calendar patterns
Volatility scalingDivide 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.

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonCointegrationCointegration means two non stationary series share a long run relationship. Learn the Engle Granger and Johansen tests, hedge ratios and pairs trading uses.

Mentioned in