facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.38k stars 4.52k forks source link

Is there any way to predict the value covering the several high points? #714

Closed TaurusYin closed 5 years ago

TaurusYin commented 6 years ago

image

Here you can see there are around 10 points out of the forecast interval in every period. Any parameters need to adjust to fit that case?

vhpietil commented 6 years ago

Try increasing fourier order of daily seasonality.

TaurusYin commented 5 years ago

Try increasing fourier order of daily seasonality.

Thanks, I tried to adjust the fourier order but failed since the raw data is 1min level, it still cannot cover all the points. How to set the fourier order for 1min level data?

mdl = Prophet(seasonality_mode='multiplicative',interval_width=0.80, mcmc_samples=30,uncertainty_samples=30, changepoint_prior_scale=0.01, changepoint_range=1.0,) mdl.add_seasonality( name='hourly', period=24, fourier_order=30, prior_scale=0.1)

image

vhpietil commented 5 years ago

Seems like your data in the second plot is different from the first plot.

Is your data on 1 min resolution and there is like 2 or 3 very high values in a day and all the rest are basically zero?

TaurusYin commented 5 years ago

I tried both 1 min and 15 mins level data, the result looks similar. The data actually are all around 0 but upper than 0. Every day at midnight, it has 2 or 3 huge value at around 1:00 to 2:00.

The forecast result sometimes the yhat is under 0 and it failed to get the periodic anomaly points.

Sent from my iPhone

On 1 Nov 2018, at 5:56 PM, vhpietil notifications@github.com wrote:

Seems like your data in the second plot is different from the first plot.

Is your data on 1 min resolution and there is like 2 or 3 very high values in a day and all the rest are basically zero?

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bletham commented 5 years ago

I noticed

mdl.add_seasonality(
name='hourly', period=24, fourier_order=30, prior_scale=0.1)

The period input needs to be the length of the period in days. So, a seasonality over one day has period=1.

I agree with @vhpietil that here the issue is that the daily seasonality is not able to change quickly enough to capture those very quick increases at the start of the day. Increasing fourier order will allow it to change faster.

Since you know that it happens at a particular time, an alternative would be to add an extra regressor that is 1 during that time and 0 otherwise. This would allow it to learn that particular effect.