pyflux icon indicating copy to clipboard operation
pyflux copied to clipboard

Prediction of business days gets the wrong index

Open jlowin opened this issue 8 years ago • 1 comments

I believe the code for model.shift_dates() uses the difference between the last two dates to infer the next gap, but this fails when the last two dates are a Friday and a Monday. shift_dates() infers that the next prediction should be for a 3 day gap and chooses Thursday as the predicted index.

This might be the same issue as #95. (edit: never mind, I don't think it is)

I saw in an earlier issue (#1, actually) that a workaround is to use integer indices. Perhaps if users specify a Pandas DateTimeIndex with a frequency, you could use that frequency to ask for the next N dates (for example, a daily index, business day index, month end index, etc.)?

jlowin avatar Jun 21 '17 20:06 jlowin

Yes, it doesn't work for business days (very naive implementation with shift_dates!). Workaround in meantime is to replace the index with your own index.

RJT1990 avatar Sep 28 '17 16:09 RJT1990