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 to max_lag; otherwise, max_lag is the maximum number of lags considered in a lag selection procedure that minimizes the lag_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


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.


[R65]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.
[R66]R’s forecast::OCSB test source code:


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 the seasonal differencing term.


x : array-like, shape=(n_samples,)

The time series vector.


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.


Get parameters for this estimator.


deep : bool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.


params : mapping of string to any

Parameter names mapped to their values.


Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.


**params : dict

Estimator parameters.


self : object

Estimator instance.