Computes the KPSS statistic (Kwiatkowski, Phillips, Schmidt & Shin, 1992) for
level stationarity of a one-dimensional signal. The residuals from regressing
the signal on a constant are cumulatively summed, and the statistic is
\(\eta = N^{-2}\sum_t S_t^2 / \hat\lambda^2\), where \(S_t\) are the
partial sums and \(\hat\lambda^2\) is a Bartlett (Newey-West) long-run
variance estimate with truncation lag. Unlike the Augmented
Dickey-Fuller test, the KPSS null is stationarity: a small
statistic (below the critical value) means the series is consistent with
stationarity. The statistic is the same deterministic quantity as
statsmodels.tsa.stattools.kpss(regression = "c", nlags = lag).
Details
Note: only the statistic is computed here (an exact quantity). The KPSS critical values and p-value come from the reference tables (an approximation) and are not returned.
References
Kwiatkowski, D., Phillips, P.C.B., Schmidt, P., Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54(1-3), 159-178.