adf_test#

impulso.adf_test(data, variables=None, *, regression='c', max_lags=None, lag_selection='aic', alpha=0.05)[source]#

Augmented Dickey-Fuller (ADF) unit-root test, one series at a time.

The null hypothesis is that the series has a unit root. A small p-value therefore argues against a unit root, i.e. for stationarity — the opposite orientation to kpss_test. Running both is the usual practice, because ADF has low power against near-unit-root alternatives.

Parameters:
  • data (VARData | DataFrame | Series) – VARData (endogenous block only), DataFrame, or Series.

  • variables (Sequence[str] | None) – Subset of column names to test. Defaults to all.

  • regression (Literal['n', 'c', 'ct']) – Deterministic terms in the test regression. “n” for none, “c” for a constant, “ct” for a constant and linear trend. Use “ct” when the series has a visible trend, otherwise the test confuses trend with a unit root.

  • max_lags (int | None) – Maximum lag length considered. Defaults to the statsmodels rule, 12 * (T / 100) ** 0.25.

  • lag_selection (Literal['aic', 'bic', 't-stat'] | None) – Criterion used to pick the lag length up to max_lags. Pass None to use max_lags itself.

  • alpha (float) – Significance level for the reported conclusion.

Returns:

StationarityTestResult with one row per variable.

Raises:

ValueError – If regression, lag_selection, or alpha is invalid.

Return type:

StationarityTestResult

Expand for references to impulso.adf_test

Stationarity Pitfalls in Climate Data / Trend stationarity versus difference stationarity

Testing for Stationarity and Cointegration / Unit-root tests

Model Checks and Validation