Augmented Dickey-Fuller test (ADF)
Time series · reference distribution: τ (Dickey-Fuller)
When to use it
Check whether a time series has a unit root, that is, whether it is non-stationary.
Null hypothesis
The series has a unit root (it is not stationary).
Assumptions
- Choose the number of lags carefully
- State whether there is a constant and a trend
Test statistic
\Delta y_t = \alpha + \gamma\, y_{t-1} + \sum_i \delta_i\, \Delta y_{t-i} + \varepsilon_t, \qquad \tau = \dfrac{\hat{\gamma}}{SE(\hat{\gamma})}How to report it
ADF = −3.62, 4 lags, p = .034: rejects the unit root
In R and Python
R
library(tseries)
adf.test(series)
Python
from statsmodels.tsa.stattools import adfuller
adfuller(series)
In Python, stats is scipy.stats and np is numpy.
Variants and alternatives
- KPSS, with the null hypothesis reversed
Where it sits in the catalog
Time series. For observations ordered in time, where neighboring values tend to be correlated: they test stationarity and autocorrelation.
In the decision tree
- What do you want to do? Analyze a time series
- What do you want to know? Whether the series is stationary