I was trying to find the optimal parameter order by using a loop:
d = 1
for p in range(3):
for q in range(3):
try:
order = (p, 0, q)
params = (p, d, q)
arima_mod = ARIMA(ts.dropna(), order).fit(method = 'css-mle', disp = 0)
arima_mod_aics[params] = arima_mod.aic
except:
pass
and I have received the message:
/usr/local/lib/python2.7/dist-packages/statsmodels-0.6.1-py2.7-linux-x86_64.egg/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
"Check mle_retvals", ConvergenceWarning)
I would like to ignore this warning, what should I do? Any suggestion?
Thanks in advance.
To specifically ignore ConvergenceWarnings:
import warnings
from statsmodels.tools.sm_exceptions import ConvergenceWarning
warnings.simplefilter('ignore', ConvergenceWarning)
See this example from the statsmodels sourceforge, especially In [17]:
.
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
# Line that is not converging
likev = mdf.profile_re(0, dist_low=0.1, dist_high=0.1)
A clean way to do it is to use the included warn_convergence
. You can pass it to fit method like so:
arima.fit(method_kwargs={"warn_convergence": False})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With