Repository navigation
Description
Describe the bug
ARMA mutaes on each call. This leads to many problems, including
Code Sample, a copy-pastable example if possible
import statsmodels.api as sm
import numpy as np
mod = sm.tsa.ARMA(np.random.randn(1000),(2,0))
mod.fit()
mod.fit()
...
ValueError: x contains a constant. Adding a constant with trend='c' is not allowed.Details
Note: As you can see, there are many issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates.
Note: Please be sure you are using the latest released version of statsmodels, or a recent build of master. If your problem has been fixed in an unreleased version, you might be able to use master until a new release occurs.
Note: If you are using a released version, have you verified that the bug exists in the master branch of this repository? It helps the limited resources if we know problems exist in the current master so that they do not need to check whether the code sample produces a bug in the next release.
Expected Output
Never mutatute the model. Will need a depreacation cycle, but worth it.
Output of import statsmodels.api as sm; sm.show_versions()
Details
INSTALLED VERSIONS
Python: 3.7.3.final.0
Statsmodels
Installed: 0.10.0 (C:\Anaconda\lib\site-packages\statsmodels)
Required Dependencies
cython: 0.29.11 (C:\Anaconda\lib\site-packages\Cython)
numpy: 1.16.4 (C:\Anaconda\lib\site-packages\numpy)
scipy: 1.2.1 (C:\Anaconda\lib\site-packages\scipy)
pandas: 0.24.2 (C:\Anaconda\lib\site-packages\pandas)
dateutil: 2.8.0 (C:\Anaconda\lib\site-packages\dateutil)
patsy: 0.5.1 (C:\Anaconda\lib\site-packages\patsy)
Optional Dependencies
matplotlib: 3.1.0 (C:\Anaconda\lib\site-packages\matplotlib)
backend: module://ipykernel.pylab.backend_inline
cvxopt: Not installed
joblib: 0.13.2 (C:\Anaconda\lib\site-packages\joblib)
Developer Tools
IPython: 7.6.1 (C:\Anaconda\lib\site-packages\IPython)
jinja2: 2.10.1 (C:\Anaconda\lib\site-packages\jinja2)
sphinx: 2.1.2 (C:\Anaconda\lib\site-packages\sphinx)
pygments: 2.4.2 (C:\Anaconda\lib\site-packages\pygments)
pytest: 5.0.0 (C:\Anaconda\lib\site-packages)
virtualenv: Not installed
Activity
jbrockmendel commentedon Jul 19, 2019
Are you thinking of just patching ARMA to avoid attribute setting (which I'm +1 on regardless) or getting at the root of the problem with the constructor args/kwargs?
bashtage commentedon Jul 19, 2019
Both, short term patch, but start deprecation for API change
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs
ENH/BUG: Add check to AR and ARMA instance to prevent bugs