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.59k stars 234 forks source link

Differences between Q parameter values #436

Closed filiphagan closed 3 years ago

filiphagan commented 3 years ago

Question I applied auto_arima to several time series and I'm having a hard time interpreting the results of the Q parameter. Examples below:

SARIMAX(0, 1, 1)x(1, 0, 1, 12)                
SARIMAX(0, 1, 2)x(1, 0, [1], 12)              

SARIMAX(0, 1, 1)x(2, 0, [], 12)               
SARIMAX(5, 0, 0)x(4, 0, 0, 12)                

SARIMAX(2, 1, 1)x(0, 0, 4, 12)                
SARIMAX(4, 1, 1)x(0, 0, [1, 2, 3, 4], 12)     
  1. What's the difference between 1 and a list of 1?
  2. What's the difference between an empty list and 0?
  3. What's the difference between 4 and a list [1, 2, 3, 4]?

According to statsmodels docs https://www.statsmodels.org/dev/_modules/statsmodels/tsa/statespace/sarimax.html#SARIMAX

P and Q may either be an integers indicating the AR and MA orders (so that all lags up to those orders are included) or else iterables giving specific AR and / or MA lags to include.

So here I would expect 1 instead of [1] and 4 instead of [1,2,3,4]. Am I missing something?

Versions (if necessary) Linux-4.14.231-173.361.amzn2.x86_64-x86_64-with-debian-10.6 Python 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0] pmdarima 1.8.2 NumPy 1.19.5 SciPy 1.4.1 Scikit-Learn 0.24.2 Statsmodels 0.12.2

tgsmith61591 commented 3 years ago

Can you share the code used that resulted in these models? Under the hood, this is simply creating statsmodels SARIMAX models over which we have no control, but if you can share the code that produced these I might be able to explain what's going on

tgsmith61591 commented 3 years ago

Closing due to inactivity. Please reopen with more details, if needed.