nsdiffs(x, m, max_D=2, test='ocsb', **kwargs)¶
Estimate the seasonal differencing term,
Perform a test of seasonality for different levels of
Dto estimate the number of seasonal differences required to make a given time series stationary. Will select the maximum value of
Dfor which the time series is judged seasonally stationary by the statistical test.
x : array-like, shape=(n_samples, [n_features])
The array to difference.
m : int
The number of seasonal periods (i.e., frequency of the time series)
max_D : int, optional (default=2)
Maximum number of seasonal differences allowed. Must be a positive integer. The estimated value of
Dwill not exceed
test : str, optional (default=’ocsb’)
Type of unit root test of seasonality to use in order to detect seasonal periodicity. Valid tests include (“ocsb”, “ch”). Note that the CHTest is very slow for large data.
D : int
The estimated seasonal differencing term. This is the maximum value of
D <= max_Dand the time series is judged seasonally stationary. If the time series is constant, will return 0.