non Invertible of a ARIMA model

前端 未结 1 1118
误落风尘
误落风尘 2021-01-11 10:43

I am trying to write a code to generate a series of arima model and compare different models.The code is as follow.

p=0
q=0
d=0
pdq=[]
aic=[]

for p in range         


        
相关标签:
1条回答
  • 2021-01-11 11:25

    Use try: ... except: ... to catch the exception and continue

    for p in range(6):
        for d in range(2):
            for q in range(4):
                try:
                    arima_mod=sm.tsa.ARIMA(df,(p,d,q)).fit(transparams=True)
    
                    x=arima_mod.aic
    
                    x1= p,d,q
                    print (x1,x)
    
                    aic.append(x)
                    pdq.append(x1)
                except:
                    pass
                    # ignore the error and go on
    
    0 讨论(0)
提交回复
热议问题