Skip to content
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

No availability of maxiter in fit method of ARIMA in v0.13 #8184

Closed
AlanFeder opened this issue Mar 22, 2022 · 1 comment
Closed

No availability of maxiter in fit method of ARIMA in v0.13 #8184

AlanFeder opened this issue Mar 22, 2022 · 1 comment

Comments

@AlanFeder
Copy link

Describe the bug

I am trying to run ARIMA, and I am getting an error with converging MLE:

from statsmodels.tsa.arima.model import ARIMA
ARIMA(my_data, order = (2, 1, 2), trend='t').fit()
/opt/conda/lib/python3.7/site-packages/statsmodels/base/model.py:606: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  ConvergenceWarning)

When I check mle_retvals, I see the following output:

{'fopt': 0.9687220792725459,
 'gopt': array([-3.33757721e-04, -2.34923891e-04, -1.27820476e-04, -4.22976099e-06,
        -6.21658280e-07, -4.79204676e-04]),
 'fcalls': 525,
 'warnflag': 1,
 'converged': False,
 'iterations': 50}

Looking around the internet, I see that in previous versions of statsmodels, I could just add the following argument into "fit": .fit(maxiter=200). However, when I try running that now, I get the following error:

TypeError: fit() got an unexpected keyword argument 'maxiter'

Is there a way to change the maximum number of iterations that I am missing?

Thank you,

Output of import statsmodels.api as sm; sm.show_versions()

[paste the output of import statsmodels.api as sm; sm.show_versions() here below this line]
INSTALLED VERSIONS

Python: 3.7.10.final.0
OS: Linux 4.14.262-200.489.amzn2.x86_64 #1 SMP Fri Feb 4 20:34:30 UTC 2022 x86_64
byteorder: little
LC_ALL: C.UTF-8
LANG: C.UTF-8

statsmodels

Installed: 0.13.2 (/opt/conda/lib/python3.7/site-packages/statsmodels)

Required Dependencies

cython: 0.29.15 (/opt/conda/lib/python3.7/site-packages/Cython)
numpy: 1.21.4 (/root/.local/lib/python3.7/site-packages/numpy)
scipy: 1.7.3 (/root/.local/lib/python3.7/site-packages/scipy)
pandas: 1.3.5 (/opt/conda/lib/python3.7/site-packages/pandas)
dateutil: 2.8.1 (/opt/conda/lib/python3.7/site-packages/dateutil)
patsy: 0.5.2 (/opt/conda/lib/python3.7/site-packages/patsy)

Optional Dependencies

matplotlib: 3.1.3 (/opt/conda/lib/python3.7/site-packages/matplotlib)
backend: module://ipykernel.pylab.backend_inline
cvxopt: Not installed
joblib: 1.0.1 (/root/.local/lib/python3.7/site-packages/joblib)

Developer Tools

IPython: 7.12.0 (/opt/conda/lib/python3.7/site-packages/IPython)
jinja2: 3.0.3 (/opt/conda/lib/python3.7/site-packages/jinja2)
sphinx: 2.4.0 (/opt/conda/lib/python3.7/site-packages/sphinx)
pygments: 2.5.2 (/opt/conda/lib/python3.7/site-packages/pygments)
pytest: 5.3.5 (/opt/conda/lib/python3.7/site-packages/pytest)
virtualenv: Not installed

Thank you

@bashtage
Copy link
Member

Use SARIMAX, which supports maxiter. ARIMA does not accept the full set of optimization parameters since these only make sense for some of the available estimators.

Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants