Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prophet forecast amplitude is too low compared to actual data, daily seasonality is wrong. #2596

Open
vladchestTELUS opened this issue Jul 3, 2024 · 1 comment

Comments

@vladchestTELUS
Copy link

I am experiencing issues with having Prophet fit daily usage data. Based on my understanding of the data there is daily, very likely weekly and monthly (possibly annual) components. I have 90d of 15min data. The forecast is interested in next week forecast at 15 min increments. Pretty sure the data is stationary in the data I am using for testing (non stationary is also possible but currently a specific case is used to avoid that).

First when I let prophet do its own thing it does something very odd to the daily seasonality:
P = Prophet()
...
P.plot_components(fcast)
P.plot(fcast, figsize=(60,6)) #is there a way to plot specific subregion instead of full data?
image
image
image

The daily seasonality has way too many bumps in it. The amplitude of daily forecast is also very low. For weekly seasonality there is a large drop around wed, which seems to be exaggerated as the original data (black) has relatively same lows.

I am able to somewhat manage the daily seasonality if I force it myself:
P = Prophet(daily_seasonality=False)
P.add_seasonality(name="daily", period=1, fourier_order=1) #increasing fourier_order to higher number leads to multiple bumps rather than bettermatching of the data
...
P.plot_components(fcast)
P.plot(fcast, figsize=(60,6)) #is there a way to plot specific subregion instead of full data?
image
image
image
The data is matched closer but the amplitude of the forecast is still a big issue.

I tried adjusting # of changepoints (ie 90*10) no impact,
changepoint_prior_scale set to 0.17 improves a little bit:
image
image
image

I tried logistic growth not helpful.
Setting daily seasonality to multiplicative goes too ham on the amplitude and the period is offset:

P = Prophet(daily_seasonality=False, changepoint_prior_scale=0.17) # daily_seasonality=False, weekly_seasonality=False #, weekly_seasonality=False, changepoint_prior_scale=0.17, n_changepoints=90*10
P.add_seasonality(name="daily", period=1, fourier_order=1, mode="multiplicative")

removing changepoint_prior_scale leads to worse match, fourier increase leads to more bumps

Best match with multiplicative and changepoint_prior_scale=0.17 (code above):
image
image
image

Any suggestions as to how I can match the data better (each day is a spike)?

@vladchestTELUS
Copy link
Author

small update:

P = Prophet(daily_seasonality=False, changepoint_prior_scale=0.0925) 
P.add_seasonality(name="daily", period=1, fourier_order=1, mode="multiplicative")

Is a little bit better amplitude match, but its out of sync with actual data and is off on the low part:
image
image
image
Any suggestions as to how I can match the data better (each day is a spike)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant