-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ARIMA MLE convergence failure in a case where it is not obvious why it would fail to converge #492
Comments
Taking a look at this @fkiraly, I can reproduce. |
Just a quick follow-up, RCA still in progress. This is ultimately the model that is fit, and it fails at the statsmodels level as well. Distilled, and setting import numpy as np
from statsmodels import api as sm
X = None
y = np.array([
3066.3, 3260.2, 3573.7, 3423.6, 3598.5, 3802.8, 3353.4, 4026.1,
4684. , 4099.1, 3883.1, 3801.5, 3104. , 3574. , 3397.2, 3092.9,
3083.8, 3106.7, 2939.6
])
arima = sm.tsa.statespace.SARIMAX(
endog=y,
exog=X,
order=(0, 1, 5),
seasonal_order=(0, 0, 0, 0),
trend=None,
)
arima_results = arima.fit(
start_params=None,
method="lbfgs",
maxiter=50,
disp=5,
) This is the error I am seeing:
Seems potentially related to the way the statsmodels In [91]: arima.start_params
/opt/miniconda3/envs/ml/lib/python3.7/site-packages/statsmodels/tsa/statespace/sarimax.py:902: RuntimeWarning: Mean of empty slice.
params_variance = (residuals[k_params_ma:] ** 2).mean()
/opt/miniconda3/envs/ml/lib/python3.7/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/opt/miniconda3/envs/ml/lib/python3.7/site-packages/statsmodels/tsa/statespace/sarimax.py:978: UserWarning: Non-invertible starting MA parameters found. Using zeros as starting parameters.
warn('Non-invertible starting MA parameters found.'
Out[91]: array([-0., 0., -0., -0., 0., nan]) |
Opened a new bug with statsmodels: |
Just an update here. The statsmodels issue was closed about 2 weeks ago, but still awaiting a new release before we bump our dependency version and mark this resolved. |
Thanks. So it'll be in next autoarima release? Any ideas when? Keen to pick up the fix |
@noahberhe Statsmodels still hasn't cut a new release yet, so even if we shipped today the issue would still be present. We're waiting until their next release to pin the updated version |
Hello, i'm working on a electricty forecasting project.. and i still got a probleme in the convergence.. |
Describe the bug
Pasting some breaking code, reduced from
sktime
code posted there by @Garrus990, here: sktime/sktime#1871A seemingly innocuous application of
ARIMA
leads to what looks like an MLE convergence failure.To Reproduce
Versions
Expected Behavior
this produces a forecast instead of crashing
Actual Behavior
causes traceback
Additional Context
Workaround:
apparently, appending any three values to the series makes it work. Mysterious.
I also do not see an obvious "degrees of freedom" problem here, e.g., why the MLE would be singular.
The text was updated successfully, but these errors were encountered: