I am using statsmodels.tsa.statespace.sarimax to make prediction. Here is my code
pprint(list(rolmean_df.index)[0])
>> datetime.date(2015, 5, 19)
mod = sm.tsa.statespace.SARIMAX(rolmean_df['IC_10_diff'], trend='n', order=(2,1,2))
results = mod.fit()
s = results.get_prediction(start = pd.to_datetime('2016-01-01').date(), dynamic= False)
>> ValueError: Start must be in dates. Got 2016-01-01 | 2016-01-01 00:00:00
I am not sure whether my "start" format is wrong or something else does not work.
From the doc: http://www.statsmodels.org/dev/generated/statsmodels.tsa.statespace.sarimax.SARIMAXResults.html
so, "Start must be in dates" means start should be in your data set.
If you want to use the model to forecase , use get_forecast().
I had a similar problem. You have to make sure that the start date is contained within rolmean_df['IC_10_diff']
.
Just print all the values in `rolmean_df['IC_10_diff']' and pick the closest one to 2016-01-01.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With