pmdarima.arima.ADFTest

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.

Parameters:

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))

Notes

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.

References

[R47]

R’s tseries ADF source code: https://bit.ly/2EnvM5V

Methods

get_metadata_routing()

Get metadata routing of this object.

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.

should_diff(x)

Test whether the time series is stationary or needs differencing.

__init__(alpha=0.05, k=None)[source][source]