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
{{ message }}
Repository navigation
ARMAResult.predict insconsistency in 'end' paramter sm-0.5.0-10 #1857
There is a really annoying inconsistency in the way ARMAResults.predict handles the end parameter in statsmodels 0.5.0-10 (from enthought distro).
If you pass pandas timestamps as the start and end paramters,
d = pd.to_datetime("2014-07-15 08:32")
armaReg.predict(start=d,end=d + pd.to_timedelta(30,unit='m'),dynamic=True).plot(color="r")
you get an error:
C:\Users\xxx\local\Enthought\Canopy\User\lib\site-packages\statsmodels\tsa\base\tsa_model.pyc in _get_predict_end(self, end)
201
202 elif freq is None: # should have a date with freq = None
--> 203 raise ValueError("When freq is None, you must give an integer "
204 "index for end.")
205
ValueError: When freq is None, you must give an integer index for end.
If instead you convert the end parameter to a string by calling __str__(), which is then parsed by statsmodels, it works fine.
It's a different error now, but the result is the same. I suppose we can try harder here, but the main issue is that the Timestamp doesn't have any frequency associated with it when it's passed in.
idx = pd.util.testing.getTimeSeriesData(nper=100, freq='T')['A'].index
y = sm.tsa.arma_generate_sample([1, .75], [1, .25], nsample=100)
y = pd.Series(y, index=idx)
mod = sm.tsa.ARMA(y, (1, 1)).fit()
d = pd.to_datetime('2000-01-01 01:38')
mod.predict(start=d, end=d + pd.to_timedelta(30, unit='m'))
Activity
jseabold commentedon Jul 31, 2014
Can you try it with current master? If it still doesn't work, PR would be welcome.
lJoublanc commentedon Jul 31, 2014
As it's part of the Enthought distribution, I can't really upgrade it until they release a new version. I'll let you know then...
jseabold commentedon Jul 31, 2014
If you can post a fully reproducible
On Jul 31, 2014 11:36 AM, "lJoublanc" [email protected] wrote:
If you can post a fully reproducible example that would be helpful.
lJoublanc commentedon Aug 10, 2014
Sorry for the delay; I'll try to do this sometime during this week. Have to do it from work so I need to make some time for that..
jseabold commentedon Oct 21, 2014
Wanted to check that this is solved. Can you post the example?
jseabold commentedon Oct 21, 2014
It's a different error now, but the result is the same. I suppose we can try harder here, but the main issue is that the Timestamp doesn't have any frequency associated with it when it's passed in.
I'll look at this for 0.6.1.
josef-pkt commentedon Feb 6, 2015
@jseabold This still has a 0.6 milestone.
Is it still relevant? Do we push it to the 0.8 milestone?
bashtage commentedon Aug 3, 2020
Fixed in master.