Stats TimeSeries stationarity tests - CyrilB1531/lodestar GitHub Wiki

HomeStats-TimeSeries

Stationarity tests — Lodestar.Stats.TimeSeries

Two tests that answer the question a correlogram raises and cannot settle: may this series be modelled as it stands, or does it need differencing or detrending first? Both at statsmodels 0.15.0 parity.

test its null entry point
augmented Dickey-Fuller the series has a unit root Stationarity.AugmentedDickeyFuller
KPSS the series is stationary around a level or a line Stationarity.Kpss

The nulls are opposite, so a reader runs both. A small ADF p-value rejects a unit root; a small KPSS p-value rejects stationarity. Rejecting one and not the other points the same way from two sides; rejecting both or neither says the series is too short, or its trend is not what the test assumed.

type carries
Stationarity the two tests
DickeyFullerOptions the trend terms, the lag rule and the maximum lag
DickeyFullerResult the statistic, MacKinnon's p-value and critical values, the lag used
KpssOptions the null's trend and the lag window rule
KpssResult the statistic, its tabulated p-value, and whether that p-value was clamped
TrendTerms constant, linear trend, quadratic trend, or nothing
LagSelection Akaike, Schwarz, the t statistic, or a fixed lag
KpssLagRule Hobijn's automatic window, Schwert's legacy one, or a fixed one
PValueBound which way the truth lies when a p-value is the end of its table

The Python equivalence table maps each statsmodels call to its counterpart here.