Strange forecasting when input sequence has time gaps
- Dominant language
- Python
- Stars
- 20.4k
- Forks
- 4.6k
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 1
Description
**Context**
I am using the following model (fbprophet version 0.7.1)
```
model = Prophet(daily_seasonality = True, yearly_seasonality = False, weekly_seasonality = True,
seasonality_mode = 'additive', interval_width = 0.99, changepoint_range = 0.8)
model = model.fit(preceding_data) # 30 days of preceding data spaced by 1 hour
pred = model.predict(future_timestamps) # forecast for several hours in the future
```
Sometimes preceding data would have time gaps due to insufficient sample size for at some time steps. Most of the time, this does not pose a problem since the `ds` column in preceding data is not required to be equally spaced.
**Problem**
*Sometimes* for some reason the forecast is way off. Below, 289 of the 720 points of preceding data is missing, mostly when the value of `y` was close to 0. Nothing indicates in the preceding data that the value of `y` might surpass 1 in the future, but Prophet make a very strange forecast:

This is due to the "daily" component of the prediction:

Interestingly, if I fill in the time gaps with missing data, the problem disappears:

This makes me think that the time gaps are somehow responsible for the strange forecast. It is unclear to me why this happens in this case, but works normally in the majority of cases.
Contributor guide
Assessment
This issue has not been assessed yet.