You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On version 0.7.0.dev0+6e66a5e, calling SARIMAXResultsWrapper.resid throws an exception here because it gets the resid method instance on the underlying results object, instead of actually calling the method and getting the ndarray. So result is a result in that line is a bound method, which of course doesn't have squeeze.
Type is major bug. Affects resid, fittedvalues, which are functions right now. They can't be assigned @cache_readonly because the various attach_dates wrapper functions don't appear (?) to allow > 1-dim data, and these are in general 2-dim objects for state space.
I guess the quick fix will be to assign them as @cache_readonly and then change the wrapper behavior to None rather than 'dates'. Then I can fix the attach_dates wrapper.
Why are resid and fittedvalues 2d for univariate SARIMAX?
IIUC, we will have to overwrite or generalize the wrapper somewhere creating a DataFrame instead of a series.
(discrete.MNLogit should have 2d fittedvalues, but it doesn't have any special wrapper code that I can see.)
Why are resid and fittedvalues 2d for univariate SARIMAX?
This was to maintain consistency with the State space wrapper, which is generic for multivariate models. But I suppose in the univariate cases we should squeeze that axis out.
Activity
ChadFulton commentedon Aug 16, 2015
Thanks for the report! I can replicate. I'll get a patch together ASAP.
ChadFulton commentedon Aug 16, 2015
Type is major bug. Affects
resid,fittedvalues, which are functions right now. They can't be assigned@cache_readonlybecause the variousattach_dateswrapper functions don't appear (?) to allow > 1-dim data, and these are in general 2-dim objects for state space.I guess the quick fix will be to assign them as
@cache_readonlyand then change the wrapper behavior toNonerather than'dates'. Then I can fix theattach_dateswrapper.ChadFulton commentedon Aug 16, 2015
Strange, we actually do have a unit test that tests both of these, as functions, and appears to have been passing.
ChadFulton commentedon Aug 16, 2015
Ah, of course, because the test was on a numpy array without dates, and it only tries to attach dates with Pandas or dates set.
josef-pkt commentedon Aug 16, 2015
Why are resid and fittedvalues 2d for univariate SARIMAX?
IIUC, we will have to overwrite or generalize the wrapper somewhere creating a DataFrame instead of a series.
(discrete.MNLogit should have 2d fittedvalues, but it doesn't have any special wrapper code that I can see.)
ChadFulton commentedon Aug 21, 2015
This was to maintain consistency with the State space wrapper, which is generic for multivariate models. But I suppose in the univariate cases we should squeeze that axis out.
josef-pkt commentedon Aug 21, 2015
If possible, then you should squeeze it. Especially for consistency with ARMA and other models.
However, the code that @hxu linked to https://github.com/statsmodels/statsmodels/blob/master/statsmodels/base/data.py#L534 does inconsistent squeezing (should do it either also in the construction of the Series or not at all.)
TST: Add failing test for Bug statsmodels#2584
ChadFulton commentedon Aug 21, 2015
The PR #2598 fixes this problem, and also fixes the inconsistent squeezing in
attach_rows.TST: Add failing test for Bug statsmodels#2584
TST: Add failing test for Bug statsmodels#2584
TST: Add failing test for Bug statsmodels#2584
bashtage commentedon Jul 22, 2019
Closing as fixed in master.