pyflux icon indicating copy to clipboard operation
pyflux copied to clipboard

Prediction - indices for forward predictions with half-hourly data

Open Nicolas99-9 opened this issue 9 years ago • 5 comments

I found a bug with ARIMA prediction. I have trained the model. The last lines of my data : 2012-12-27 03:00:00 0 2012-12-27 03:30:00 0 2012-12-27 04:00:00 0 2012-12-27 04:30:00 0 2012-12-27 05:00:00 0 2012-12-27 05:30:00 0 2012-12-27 06:00:00 0 2012-12-27 06:30:00 0 2012-12-27 07:00:00 0 2012-12-27 07:30:00 0 2012-12-27 23:00:00 0 2012-12-27 23:30:00 0

Model training : model = pf.ARIMA(data=sub_data,ar=4,ma=4,integ=0,target='passengers') x = model.fit("MLE")

When I try to predict :
tmp_prediction = model.predict(7)

It returns the 7 last data (from the paste). There is a problem with the predictions. I would like to predict the future not the past !

2012-12-27 05:30:00 0.006293 2012-12-27 06:00:00 0.008389 2012-12-27 06:30:00 0.008493 2012-12-27 07:00:00 0.008549 2012-12-27 07:30:00 0.008560 2012-12-27 23:00:00 0.008603 2012-12-27 23:30:00 0.008612

How to solve that ?

Nicolas99-9 avatar Dec 24 '16 08:12 Nicolas99-9

This is more likely to be an issue with the indexing rather than the values. What has likely happened is that the index has not rolled forward. Will look into it.

RJT1990 avatar Dec 24 '16 09:12 RJT1990

So it's a problem with the index but the values are really predicted ahead ?

Nicolas99-9 avatar Dec 24 '16 09:12 Nicolas99-9

I can't confirm that right now but that is my strong suspicion.

RJT1990 avatar Dec 24 '16 09:12 RJT1990

I don't know if it could help you but the the start date of my ARIMA model (summary function) is different from the first date of the index.

Please let me know if you correct the bug.

Nicolas99-9 avatar Dec 24 '16 14:12 Nicolas99-9

Have renamed this issue to reflect the problem. I think you can probability infer what the indices should be for the forward predictions in the meantime? Just add a datetime.timedelta() to correct.

RJT1990 avatar Jan 03 '17 19:01 RJT1990