makystats GitHub PyPI FR · EN

Stationarity / unit-root tests

Native unit-root and stationarity tests in makystats.stationarity_test (not estimation models). Inspectable OLS tables, multi-specification compares, and sequential ADF strategy.

Guide: makystats/stationarity_test/README.md

Import

from makystats import (
    adf, adf_sequential,
    kpss, pp, dfgls, za,
    engle_granger, unit_root_summary,
)
# aliases: phillips_perron, zivot_andrews_test, df_gls, ers, kpss_test

Quick examples

print(adf(y, regression="ct").summary())
print(adf(y, regression="ct").ols.summary())

seq = adf_sequential(y)
print(seq.summary())
seq.plot()   # decision tree, active path highlighted

print(kpss(y, regression="c").summary())
print(pp(y, regression="ct", lags="auto").summary())
print(dfgls(y, regression="ct", autolag="MAIC").summary())
print(za(y, regression="ct").summary())

print(unit_root_summary(y))

Available tests

TestH₀Highlights
ADFunit rootMacKinnon p-values; .ols.summary()
ADF sequentialunit root (strategy)models 3→2→1, Φ joint tests, path plot
KPSSstationarityNewey–West; level / trend
Phillips–Perronunit rootZ(τ), Z(ρ)
DF-GLS (ERS)unit rootGLS detrending; MAIC; Perron–Qu lag policy
Zivot–Andrewsunit root without breakone endogenous break
Engle–Grangerno cointegrationtwo series

Helpers: kpss_compare, pp_compare, dfgls_compare, za_compare, adf_joint_test.

Example notebook

Sequential ADF strategy: GitHub · nbviewer · Colab