facebook / facebook/prophet

Monthly seasonality does not seem to be working correctly

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

Description

I am modeling daily revenue and the data exhibits monthly seasonality. The revenue is typically lower at the start of the month and higher in the second part of the month, especially in the last few days. When I added this (custom) seasonality to the model fbprophet seemed to learn this behavior to some extent as shown here.

![image](https://user-images.githubusercontent.com/39628595/119861910-e7c27080-bee5-11eb-90f1-d10be24acd29.png)

To illustrate the problem a sample of two months is copied below. Adding monthly seasonality improved model performance towards the end of the month (green circles). However, for some reason, the forecasts actually became higher/worse in the first few days of the month (red circles).

![image](https://user-images.githubusercontent.com/39628595/119861937-ef821500-bee5-11eb-9417-8b2728096570.png)
![image](https://user-images.githubusercontent.com/39628595/119861949-f4df5f80-bee5-11eb-887e-aadf7bf6a661.png)

Does anyone have any ideas on how to fix this? Could this have to do with the fact that the period for monthly seasonality is set to 30.5 (as in the documentation) and so over time it can become out of sync?

Looking forward to your suggestions. Thank you!

Additional information:
• Currently the monthly seasonality has been added in the code as follows:
m.add_seasonality(name='monthly', period=30.5, fourier_order=5)
• I removed yearly seasonality but I still observed the same issue
• The only other seasonality is weekly:
![image](https://user-images.githubusercontent.com/39628595/119861964-fad54080-bee5-11eb-852e-153464520dda.png)

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.