Search code examples
pythonpandasarimapmdarima

auto_arima(... , seasonal=False) but got SARIMAX 😐


I want to know the orders (p,d,q) for ARIMA model, so I've got to use pmdarima python package. but it recommends me SARIMAX model! keep reading for more details.
i used Daily Total Female Births Data for this purpose. it's a stationary time series.

# importing packages
import pandas as pd
from pmdarima import auto_arima
import warnings
warnings.filterwarnings('ignore')

# read csv file
df = pd.read_csv('/Data/DailyTotalFemaleBirths.csv' , index_col=0 , parse_dates=True)

# set daily frequency for datetime indexes
df.index.freq = 'D'

# now using auto_arima i try to find (p,d,q) orders for ARIMA model.
# so i set seasonal=False because i don't want orders for SARIMA! my
# goal is to find orders for ARIMA model not SARIMA
auto_arima(df['Births'] , start_P= 0 , start_q=0 , max_p=6 , 
            max_q=3 , d=None , error_action='ignore' , suppress_warnings=True ,
            m=12 , seasonal=False , stepwise=True).summary()

then it gives me this:
enter image description here

the problem is where although I set seasonal=False but it gives me SARIMAX (which stands for Seasonal Autoregressive Independent Moving Average) but I don't want to consider seasonal component, so I set seasonal=False! seems that pmdarima doesn't pay attention to seasonal=False!

can someone help me to figure out what is the problem?


Expected result:
enter image description here

for False Result: SARIMAX result comes from pmdarima version 1.8.3
for True Result: ARIMA result comes from pmdarima version 1.1.0


Solution

  • It's not really using a seasonal model. It's just a confusing message.

    In the pmdarima library, in version v1.5.1 they changed the statistical model in use from ARIMA to a more flexible and less buggy model called SARIMAX. (It stands for Seasonal Autoregressive Integrated Moving Average Exogenous.)

    Despite the name, you can use it in a non-seasonal way by setting the seasonal terms to zero.

    You can double-check whether the model is seasonal or not by using the following code:

    model = auto_arima(...)
    print(model.seasonal_order)
    

    If it shows as (0, 0, 0, 0), then no seasonality adjustment will be done.