Search code examples
pythontime-seriesbigdataarima

parameter combination for seasonal Arima model


I am working on a dataset data with trend and/or seasonal components using timeseries. I created TEST and TRAINING datasets and also check the perfomance using time series analysis. I am using ARIMA for serial correlations in the data to look at the differences between values in the time series

So to generate the parameter list in matrix form, I wrote the following code

warnings.filterwarnings("ignore") # specify to ignore warning messages
p = d = q = range(0,2)
seasonal_period =12
pdq = list (itertools.product(p,d,q))

seasonal_pdq = [(x[0], x[1], x[2], seasonal_period) for x in list (itertools.product(p,d,p))]
                        
print ("Example of parameter combination for seasonal Arima model")
print ("ARIMA: {} X {} ".format(pdq[1], seasonal_pdq[1]))                        
print ("ARIMA: {} X {} ".format(pdq[2], seasonal_pdq[2]))                        
print ("ARIMA: {} X {} ".format(pdq[2], seasonal_pdq[3]))  
print ("ARIMA: {} X {} ".format(pdq[2], seasonal_pdq[4]))                        

The parameter combination its giving me its incorrect to what its expected. Please, I have tried different resources but still does not solve it.


Solution

  • The ARIMA models look at differences between values in the time series. It is suitable for time series data with the trend and/or seasonal components. You are on the right path, you just made a few mistakes in your line of code. When you specified (p,d,q) inside the variable seasonal_pdq. You used (p,d,p) instead of (p,d,q). Apart from that, your parameter combination for the seasonal Arima model is wrong. Check the below code and let me know if it works for you.

    To generate the parameters list.

    warnings.filterwarnings("ignore") # specify to ignore warning messages
    p = d = q = range(0,2)
    seasonal_period =12
    pdq = list (itertools.product(p,d,q))
    
    seasonal_pdq = [(x[0], x[1], x[2], seasonal_period) for x in list (itertools.product(p,d,q))]
                            
    print ("Example of parameter combination for seasonal Arima model")
    print ("ARIMA: {} X {} ".format(pdq[1], seasonal_pdq[1]))                        
    print ("ARIMA: {} X {} ".format(pdq[1], seasonal_pdq[2]))                        
    print ("ARIMA: {} X {} ".format(pdq[2], seasonal_pdq[3]))  
    print ("ARIMA: {} X {} ".format(pdq[2], seasonal_pdq[4]))