Reputation: 161
I am currently writing a function to do a grid search for the order of a SARIMAX model: (p,q,d)X(P,Q,D,s). However, I routinely get the following types of error with the default settings on statsmodels.tsa.SARIMAX() when fitting:
ValueError: Non-stationary starting autoregressive parameters found with `enforce_stationarity` set to True.
or
ValueError: non-invertible starting MA parameters found with `enforce_invertibility` set to True.
I could stop enforcing stationarity and invertibility to stop getting these errors, however, as far as I know, I would not want model parameters which created a model that isn't invertible.
Is it ok to relax the enforce_stationarity and enforce_invertibility arguments, or would this result in poor models?
Upvotes: 6
Views: 5589
Reputation: 457
This is what I did within the for
-loop where I perform my grid search:
for ...:
try:
model = smt.SARIMAX(...)
result = model.fit()
...
except:
continue
This way, you will skip non-stationary or non-invertible models.
Upvotes: 5