Closed esraozdemir1 closed 7 years ago
Thanks for reporting. Will resolve tonight and write tests to cover this.
My index date is epoch time. It's my understanding that this is the reason of error. So , I add the "else" part into the shift_dates function as follows, then the error was fixed.
`` def shift_dates(self,h): date_index = copy.deepcopy(self.index) date_index = date_index[self.max_lag:len(date_index)] if self.is_pandas is True: if isinstance(date_index,pd.tseries.index.DatetimeIndex): if pd.infer_freq(date_index) == 'H' or pd.infer_freq(date_index) == 'M' or pd.infer_freq(date_index) == 'S': for t in range(h): date_index += pd.DateOffset((date_index[len(date_index)-1] - date_index[len(date_index)-2]).seconds) else: # Assume higher frequency (configured for days) for t in range(h): date_index += pd.DateOffset((date_index[len(date_index)-1] - date_index[len(date_index)-2]).days) elif isinstance(date_index,pd.core.index.Int64Index): for i in range(h): new_value = date_index.values[len(date_index.values)-1] + (date_index.values[len(date_index.values)-1] - date_index.values[len(date_index.values)-2]) date_index = pd.Int64Index(np.append(date_index.values,new_value))
else:
for i in range(h):
new_value = date_index.values[len(date_index.values)-1] + (date_index.values[len(date_index.values)-1] - date_index.values[len(date_index.values)-2])
date_index = pd.Int64Index(np.append(date_index.values,new_value))
Great, I'll look to incorporate that into the code. Will close this issue once next release is out.
Thanks again :)
This is in the current release.
In tsm.py , output and input date_index into "shift_dates function" is same. Because of this, predicted time is the same the last index value.