statsmodels.tsa.x13.x13_arima_select_order#
- statsmodels.tsa.x13.x13_arima_select_order(endog, maxorder=(2, 1), maxdiff=(2, 1), diff=None, exog=None, log=None, outlier=True, trading=False, forecast_periods=None, start=None, freq=None, print_stdout=False, x12path=None, prefer_x13=True, tempdir=None)[source]#
Perform automatic seasonal ARIMA order identification using x12/x13 ARIMA
- Parameters:
- endogarray_like,
Series,orDataFrame The series to model. It is best to use a pandas object with a DatetimeIndex or PeriodIndex. However, you can pass an array-like object. If your object does not have a dates index then
startandfreqare not optional.- maxorder
tupleofint,optional The maximum order of the regular and seasonal ARMA polynomials to examine during the model identification. The order for the regular polynomial must be greater than zero and no larger than 4. The order for the seasonal polynomial may be 1 or 2.
- maxdiff
tupleofint,optional The maximum orders for regular and seasonal differencing in the automatic differencing procedure. Acceptable inputs for regular differencing are 1 and 2. The maximum order for seasonal differencing is 1. If
diffis specified thenmaxdiffshould be None. Otherwise,diffwill be ignored. See alsodiff.- diff
tupleofint,optional Fixes the orders of differencing for the regular and seasonal differencing. Regular differencing may be 0, 1, or 2. Seasonal differencing may be 0 or 1.
maxdiffmust be None, otherwisediffis ignored.- exog
SeriesorDataFrame,optional Exogenous variables.
- logbool or
None,optional If None, it is automatically determined whether to log the series or not. If False, logs are not taken. If True, logs are taken.
- outlierbool,
optional Whether or not outliers are tested for and corrected, if detected.
- tradingbool,
optional Whether or not trading day effects are tested for.
- forecast_periods
int,optional Number of forecasts produced.
- start
strordatetime,optional Must be given if
endogdoes not have date information in its index. Anything accepted by pandas.DatetimeIndex for the start value.- freq
str,optional Must be given if
endogdoes not have date information in its index. Anything accepted by pandas.DatetimeIndex for the freq value.- print_stdoutbool,
optional The stdout from X12/X13 is suppressed. To print it out, set this to True.
- x12path
str,optional The path to x12 or x13 binary. If None, the program will attempt to find x13as or x12a on the PATH or by looking at X13PATH or X12PATH depending on the value of prefer_x13.
- prefer_x13bool,
optional If True, will look for x13as first and will fallback to the X13PATH environmental variable. If False, will look for x12a first and will fallback to the X12PATH environmental variable. If x12path points to the path for the X12/X13 binary, it does nothing.
- tempdir
str,optional The path to where temporary files are created by the function. If None, files are created in the default temporary file location.
- endogarray_like,
- Returns:
BunchA bunch object containing the listed attributes.
order : tuple of int The regular order.
sorder : tuple of int The seasonal order.
include_mean : bool Whether to include a mean or not.
results : str The full results from the X12/X13 analysis.
stdout : str The captured stdout from the X12/X13 analysis.
Notes
This works by creating a specification file, writing it to a temporary directory, invoking X12/X13 in a subprocess, and reading the output back in.