pmdarima.arima
.OCSBTest¶
-
class
pmdarima.arima.
OCSBTest
(m, lag_method='aic', max_lag=3)[source][source]¶ Perform an OCSB test of seasonality.
Compute the Osborn, Chui, Smith, and Birchenhall (OCSB) test for an input time series to determine whether it needs seasonal differencing. The regression equation may include lags of the dependent variable. When
lag_method
= “fixed”, the lag order is fixed tomax_lag
; otherwise,max_lag
is the maximum number of lags considered in a lag selection procedure that minimizes thelag_method
criterion, which can be “aic”, “bic” or corrected AIC, “aicc”.Critical values for the test are based on simulations, which have been smoothed over to produce critical values for all seasonal periods
Parameters: m : int
The seasonal differencing term. For monthly data, e.g., this would be 12. For quarterly, 4, etc. For the OCSB test to work,
m
must exceed 1.lag_method : str, optional (default=”aic”)
The lag method to use. One of (“fixed”, “aic”, “bic”, “aicc”). The metric for assessing model performance after fitting a linear model.
max_lag : int, optional (default=3)
The maximum lag order to be considered by
lag_method
.References
[R49] Osborn DR, Chui APL, Smith J, and Birchenhall CR (1988) “Seasonality and the order of integration for consumption”, Oxford Bulletin of Economics and Statistics 50(4):361-377. [R50] R’s forecast::OCSB test source code: https://bit.ly/2QYQHno Methods
estimate_seasonal_differencing_term
(x)Estimate the seasonal differencing term. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. -
__init__
(m, lag_method='aic', max_lag=3)[source][source]¶ Initialize self. See help(type(self)) for accurate signature.
-
estimate_seasonal_differencing_term
(x)[source][source]¶ Estimate the seasonal differencing term.
Parameters: x : array-like, shape=(n_samples,)
The time series vector.
Returns: D : int
The seasonal differencing term. For different values of
m
, the OCSB statistic is compared to an estimated critical value, and returns 1 if the computed statistic is greater than the critical value, or 0 if not.
-