Param Estimator
StationarityKPSS
Test for stationarity via the Kwiatkowski-Phillips-Schmidt-Shin Test.
Quickstart
python
from sktime.param_est.stationarity import StationarityKPSS
estimator = StationarityKPSS(p_threshold=0.05, regression='c', nlags='auto')Parameters(3)
- p_thresholdfloat, optional, default=0.05
- significance threshold to apply in testing for stationarity
- regressionstr, one of {“c”,”ct”,”ctt”,”n”}, optional, default=”c”
Constant and trend order to include in regression.
“c”: constant only (default).
“ct”: constant and trend.
- nlagsstr or int, optional, default=”auto”. If int, must be positive.
Indicates the number of lags to be used internally in
kpss. If “auto”, lags is calculated using the data-dependent method of Hobijn et al (1998). See also Andrews (1991), Newey & West (1994), and Schwert (1989). If “legacy”, uses int(12 * (n / 100)**(1 / 4)), as outlined in Schwert (1989). If int, uses that exact number.
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.param_est.stationarity import StationarityKPSS
>>>
>>> X = load_airline ()
>>> sty_est = StationarityKPSS ()
>>> sty_est. fit (X) StationarityKPSS(
... )
>>> sty_est. get_fitted_params ()["stationary" ] False