alkaline-ml / pmdarima

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.
https://www.alkaline-ml.com/pmdarima
MIT License
1.57k stars 231 forks source link

auto_arima generates SARIMAX model when seasonal=False and m=1 #292

Closed Nirmal-Neel closed 4 years ago

Nirmal-Neel commented 4 years ago

I am using auto_arima function to get the best ARIMA model for a non seasonal data. But this function is returning a SARIMAX model

auto_model = auto_arima(ts_data, start_p=1, max_p=6, start_q=1, max_q=6, max_P = 6, max_Q=6,
                        trace=True, seasonal=False, m=1, stationary=False,error_action='ignore',  
                      suppress_warnings=True,stepwise=True)

The output of the above code is Fit ARIMA: order=(1, 1, 1) seasonal_order=(0, 0, 0, 0); AIC=389.041, BIC=395.263, Fit time=0.134 seconds Fit ARIMA: order=(0, 1, 0) seasonal_order=(0, 0, 0, 0); AIC=416.144, BIC=419.255, Fit time=0.007 seconds Fit ARIMA: order=(1, 1, 0) seasonal_order=(0, 0, 0, 0); AIC=393.468, BIC=398.134, Fit time=0.029 seconds Fit ARIMA: order=(0, 1, 1) seasonal_order=(0, 0, 0, 0); AIC=392.946, BIC=397.612, Fit time=0.065 seconds Fit ARIMA: order=(0, 1, 0) seasonal_order=(0, 0, 0, 0); AIC=414.316, BIC=415.871, Fit time=0.007 seconds Fit ARIMA: order=(2, 1, 1) seasonal_order=(0, 0, 0, 0); AIC=391.011, BIC=398.788, Fit time=0.172 seconds Fit ARIMA: order=(1, 1, 2) seasonal_order=(0, 0, 0, 0); AIC=390.561, BIC=398.338, Fit time=0.263 seconds Fit ARIMA: order=(0, 1, 2) seasonal_order=(0, 0, 0, 0); AIC=388.655, BIC=394.877, Fit time=0.192 seconds Fit ARIMA: order=(1, 1, 3) seasonal_order=(0, 0, 0, 0); AIC=415.231, BIC=424.563, Fit time=0.409 seconds

It is generating a seasonal model.

Versions Windows-10-10.0.17763-SP0 Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] pmdarima 1.5.2 NumPy 1.16.4 SciPy 1.3.1 Scikit-Learn 0.20.3 Statsmodels 0.10.1

tgsmith61591 commented 4 years ago

We use SARIMAX under the hood for everything, since statsmodels has all but deprecated their ARIMA class. If you look at the trace above, you'll see seasonal_order=(0, 0, 0, 0) for all models. You're still getting a non-seasonal model.