class pmdarima.arima.ADFTest(alpha=0.05, k=None)[source][source]

Conduct an ADF test for stationarity.

In statistics and econometrics, an augmented Dickey–Fuller test (ADF) tests the null hypothesis of a unit root is present in a time series sample. The alternative hypothesis is different depending on which version of the test is used, but is usually stationarity or trend-stationarity. It is an augmented version of the Dickey–Fuller test for a larger and more complicated set of time series models.


alpha : float, optional (default=0.05)

Level of the test

k : int, optional (default=None)

The drift parameter. If k is None, it will be set to: np.trunc(np.power(x.shape[0] - 1, 1 / 3.0))


This test is generally used indirectly via the pmdarima.arima.ndiffs() function, which computes the differencing term, d.

ADF test does not perform as close to the R code as do the KPSS and PP tests. This is due to the fact that is has to use statsmodels OLS regression for std err estimates rather than the more robust sklearn LinearRegression.


[R19]R’s tseries ADF source code:


get_params([deep]) Get parameters for this estimator.
is_stationary(x) Test whether the time series is stationary.
set_params(**params) Set the parameters of this estimator.
__init__(alpha=0.05, k=None)[source][source]

Initialize self. See help(type(self)) for accurate signature.


Get parameters for this estimator.


deep : boolean, optional

If True, will return the parameters for this estimator and contained subobjects that are estimators.


params : mapping of string to any

Parameter names mapped to their values.


Test whether the time series is stationary.


x : array-like, shape=(n_samples,)

The time series vector.


pval : float

The computed P-value of the test.

sig : bool

Whether the P-value is significant at the alpha level. More directly, whether to difference the time series.


Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.