facebook / facebook/prophet

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

Open
#2,596 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

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](https://github.com/facebook/prophet/assets/123974137/9d9a4be4-59cd-4b9a-affb-9e09ae08ef59)
![image](https://github.com/facebook/prophet/assets/123974137/dd158d8c-d404-487a-9336-40bcd59e0dd7)
![image](https://github.com/facebook/prophet/assets/123974137/5ba74557-b48c-4f7f-8cef-f283cf18af05)

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](https://github.com/facebook/prophet/assets/123974137/426d39b7-be22-482c-861b-6751bbe5a647)
![image](https://github.com/facebook/prophet/assets/123974137/34c7b7b0-17f1-44c5-81b7-63e7a9adc264)
![image](https://github.com/facebook/prophet/assets/123974137/a7ef37cf-06e2-4eea-86e1-b799f0614ae5)
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](https://github.com/facebook/prophet/assets/123974137/f34b5129-c5b1-4fb6-9812-33273501b438)
![image](https://github.com/facebook/prophet/assets/123974137/5be0ddcb-7004-4c28-9eba-b848c65c5523)
![image](https://github.com/facebook/prophet/assets/123974137/c3f152fd-1cfd-420c-b20a-b49e93d4b528)

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](https://github.com/facebook/prophet/assets/123974137/25d14fe8-ce6f-4aed-b5ef-156f060d36fb)
![image](https://github.com/facebook/prophet/assets/123974137/6447b22c-2063-477b-aa41-9af249c811d8)
![image](https://github.com/facebook/prophet/assets/123974137/fde4150b-42eb-4430-a12e-04929099b792)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.