All Articles
Quantitative Finance
Advanced
6 min readDecember 15, 2024

Testing Time Series Stationarity: A Practical Guide to the Dickey-Fuller and ADF Tests

191
#DickeyFullerTest#ADFTest#TimeSeries#Stationarity#Econometrics#QuantitativeFinance#RiskManagement#ModelValidation#UnitRoot#DataScience#Forecasting#FinancialModeling#ActuarialScience

In time series modeling, stationarity is a cornerstone assumption, underpinning ARIMA models, forecasting accuracy, and inferential validity. Yet, in practice, many professionals apply models without rigorously checking this crucial condition. The Dickey-Fuller (DF) and Augmented Dickey-Fuller (ADF) tests are essential tools that help determine whether a time series is stationary or contains a unit root.

This article explores both tests, how they work, how to compute them, and most importantly, how to interpret and compare their results in real-world data.


Why Stationarity Matters

A stationary time series has:

  • Constant mean
  • Constant variance
  • No autocorrelation in the error term (or quickly dying autocorrelation)

If your data is not stationary, regression coefficients become unreliable, forecasting becomes unstable, and confidence intervals become misleading.


Dickey-Fuller (DF) Test

Concept

The Dickey-Fuller Test is designed to test the null hypothesis that a unit root is present (i.e., the series is non-stationary):

H₀: The series has a unit root (non-stationary)

H₁: The series does not have a unit root (stationary)

The test equation is:

Δyₜ = α + βt + γyₜ₋₁ + δΔyₜ₋₁ + εₜ

Where the key coefficient of interest is γ. If γ = 0, the series has a unit root.

Interpretation

  • Reject H₀ (p < 0.05) → The series is stationary
  • Fail to reject H₀ (p > 0.05) → The series is non-stationary

Augmented Dickey-Fuller (ADF) Test

Why Augment the DF Test?

The basic DF test assumes no autocorrelation in the residuals. In reality, time series often show serial correlation. The ADF Test corrects for this by adding lagged differences of the dependent variable:

Δyₜ = α + βt + γyₜ₋₁ + Σ δᵢ Δyₜ₋ᵢ + εₜ

This ensures the error term is white noise, making the test valid even with autocorrelated data.


How to Compute

Python (statsmodels):

from statsmodels.tsa.stattools import adfuller

result = adfuller(y)
print('ADF Statistic:', result[0])
print('p-value:', result[1])

R:

adf.test(y, alternative = "stationary")

Interpretation of ADF Output

  • ADF Statistic (more negative = stronger evidence of stationarity)
  • p-value < 0.05 → Reject H₀ → series is stationary
  • p-value ≥ 0.05 → Fail to reject H₀ → series is non-stationary
  • Compare the ADF statistic against critical values at 1%, 5%, and 10% significance levels

DF vs ADF – A Comparison

| Feature | Dickey-Fuller | Augmented Dickey-Fuller | |---|---|---| | Autocorrelation handling | None | Adds lagged difference terms | | Real-world applicability | Limited (assumes no serial correlation) | Broad (handles autocorrelated residuals) | | Complexity | Simple | Slightly more complex | | Use case | Ideal for simple AR(1) processes | Standard for practical time series |


Final Thoughts

Testing for stationarity is not an academic formality—it is a prerequisite for valid time series modeling. The ADF test, as an evolution of the Dickey-Fuller test, remains a gold standard in econometrics and quantitative finance.

"Before forecasting the future, ensure the present isn't drifting." — A modeler's mantra


Join the Conversation

How often do you test for unit roots before applying time series models? Have you encountered false confidence due to untested non-stationarity?

Let's explore best practices together.


Originally published on LinkedIn.