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
BUG: TSA _get_predict_start, _get_predict_end do not accept datetime objects #2780
The tsa helper functions for predict do not allow passing a datetime type, even though they allow passing a string which gets converted to a datetime type.
I thought there is a specific issue still open, but don't find it.
I added the ability to use some pandas date or time representation in there, but didn't know how many different versions there are to specify a datetime.
I also encounter the same problem trying to forecast timesries with AR, ARMA, ARIMA and passing a datetime index for start and end.
The problem here is that I can pass a pandas timeseries index for the start but not the end. The Function:
start = self._get_predict_start(start, dynamic) # line 192 of ar_model
correctly inferes the right integer index to the starting point BUT the function
end, out_of_sample = self._get_predict_end(end) # line 193 of ar_model
has no functionality to do the same for the end. In function
_validate(start, k_ar, dates, method) # line 31 ar_model
here a check is performed to also accept datetime
from datetime import datetime
if isinstance(start, (string_types, datetime)):
start_date = start
start = _index_date(start, dates)
This is not done at
_get_predict_end(self, end) # line 135 of tsa_model
here only the instances string and int are approved.
A fix for the module to accept datetimes for start and end, even for out of sample would greatly improve the usefullness and useability of the model for timeseries forecasting in combiniation with pandas.
Activity
josef-pkt commentedon Jan 19, 2016
see also #1857
I thought there is a specific issue still open, but don't find it.
I added the ability to use some pandas date or time representation in there, but didn't know how many different versions there are to specify a datetime.
Acertainuser commentedon Jan 26, 2016
I also encounter the same problem trying to forecast timesries with AR, ARMA, ARIMA and passing a datetime index for start and end.
The problem here is that I can pass a pandas timeseries index for the start but not the end. The Function:
correctly inferes the right integer index to the starting point BUT the function
has no functionality to do the same for the end. In function
here a check is performed to also accept datetime
This is not done at
here only the instances string and int are approved.
A fix for the module to accept datetimes for start and end, even for out of sample would greatly improve the usefullness and useability of the model for timeseries forecasting in combiniation with pandas.
ChadFulton commentedon Oct 8, 2017
This was fixed by the larger date refactoring.