arma with exog
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
statsmodels |
New
|
Undecided
|
Unassigned |
Bug Description
is this a bug?
import numpy as np
import scikits.
exog = sm.add_
endog = exog.sum(1) + 0.2 * np.random.
modarma = sm.tsa.ARMA(endog, exog)
resarma = modarma.
Optimization terminated successfully.
Current function value: 5.533772
Iterations 12
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sm_overview.py", line 36, in <module>
resarma = modarma.
File "E:\Josef\
start_params = self._fit_
File "E:\Josef\
start_
ValueError: shape mismatch: objects cannot be broadcast to a single shape
There is already a constant in exog, and then you try to add one with trend = 'c' in fit. The way, add_trend/ add_constant are written, they will not add another one, but the model sets k_trend = 1. I guess the error message could be more informative. Maybe the helper functions should raise a warning or an error, "X already contains a constant"?
But I get a singular matrix error from the optimization if I try to fit it with trend='nc'. This could be the case when the model is badly mis-specified rather than a bug, but I'm not sure.