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

order (0,1) breaks ARMA forecast #657

Closed
davidia opened this issue Feb 10, 2013 · 2 comments
Closed

order (0,1) breaks ARMA forecast #657

davidia opened this issue Feb 10, 2013 · 2 comments

Comments

@davidia
Copy link

davidia commented Feb 10, 2013

Hi, is this an bug or me being stupid?

from statsmodels.tsa.arima_model import ARMA
import numpy as np
data = np.random.rand(100)
arma = ARMA(data,order=(0,1))
arma_res = arma.fit()
arma_res.forecast(1)



---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-fdc2df0e7106> in <module>()
      4 arma = ARMA(data,order=(0,1))
      5 arma_res = arma.fit()
----> 6 arma_res.forecast(1)

/home/danderson/.local/lib/python2.7/site-packages/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/tsa/arima_model.pyc in forecast(self, steps, exog, alpha)
   1300         forecast = _arma_predict_out_of_sample(self.params,
   1301                 steps, self.resid, self.k_ar, self.k_ma, self.k_trend,
-> 1302                 self.k_exog, self.model.endog, exog, method=self.model.method)
   1303         # compute the standard errors
   1304         sigma2 = self.sigma2

/home/danderson/.local/lib/python2.7/site-packages/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/tsa/arima_model.pyc in _arma_predict_out_of_sample(params, steps, errors, p, q, k_trend, k_exog, endog, exog, start, method)
    110                                                    start, errors, trendparam,
    111                                                    exparams, arparams,
--> 112                                                    maparams, steps, method)
    113 
    114     forecast = np.zeros(steps)

/home/danderson/.local/lib/python2.7/site-packages/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/tsa/arima_model.pyc in _get_predict_out_of_sample(endog, p, q, k_trend, k_exog, start, errors, trendparam, exparams, arparams, maparams, steps, method)
     74         resid = np.zeros(q)
     75         if start and 'mle' in method or start == p:
---> 76             resid[:q] = errors[start-q:start]
     77         elif start:
     78             resid[:q] = errors[start-q-p:start-p]

ValueError: output operand requires a reduction, but reduction is not enabled
@jseabold
Copy link
Member

What version are you on? It looks like a bug, though the error message I get is different. I'll look into it.

@davidia
Copy link
Author

davidia commented Feb 10, 2013

I'm on head

jseabold added a commit to jseabold/statsmodels that referenced this issue Apr 9, 2013
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants