mojolearn.select_d#
- mojolearn.select_d(y, D=0, s=0, d_max=None, pval_threshold=0.05)[source]#
Choose the differencing order
dfor each series by the KPSS test.Runs kpss_test() for
d = 0, 1, ..., d_max - 1and returns, per series, the first order at which it tests stationary, ord_maxif none does. This is thedstep of cuML’sAutoARIMA.search. The seasonal orderDis not chosen: pass the one you want. Input layout and non-finite handling are as for kpss_test().- Parameters:
y (array-like of shape (n_obs, n_series) or (n_obs,)) – The series, one per column.
D (int, default 0) – Seasonal differencing applied before the test.
s (int, default 0) – Seasonal period.
d_max (int or None, default None) – Largest
dreturned; None means2 - D. Must satisfy0 <= d_max <= 2 - D.pval_threshold (float, default 0.05) – Significance level of the KPSS test.
- Returns:
Array of shape (n_series,), int32
Examples
>>> import numpy as np, mojolearn >>> y = np.random.default_rng(0).standard_normal((200, 4)).cumsum(axis=0).astype(np.float32) >>> np.asarray(mojolearn.select_d(y)).shape (4,)