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.27k stars 4.51k forks source link

Dynamic seasonality #391

Open alex-municio opened 6 years ago

alex-municio commented 6 years ago

First of all I would like to thank the developers for this awesome package. Works great and it is very straightforward to use.

Lately, I have been thinking of a possible enhancement. Prophet seasonalities are fixed since model beta parameter does not depend on time. However, weekly seasonality often evolves when training a model over several years.

¿Would it be possible to have some kind of piecewise linear beta (like we have in trend) in order to accommodate evolving seasonalities?

bletham commented 6 years ago

We've definitely seen situations where the weekly seasonality has had substantial drift. A piecewise multiplier on a seasonal component seems reasonable. I'm a bit hesitant about what it would do to the model complexity - in terms of making the model harder to fit, easier to overfit, and harder to debug. But it seems worth trying, especially if someone has any compelling examples for trying it out. I'll put this as an enhancement for the future. (More immediate targets include multiplicative weekly seasonality, which I suppose is a step in that direction).

zongyaoou commented 6 years ago

@bletham Thanks for this awesome package . It really helps me a lot. But in my prediction , I have some problems just like @alex-municio met . I'm a Chinese student , one of my study is to predict the number of every day's viewer in next month. The tough problems in my prediction is that the yearly seasonality of January to March is seriously base on the Spring Festival. It would drift year by year. But the seasonality of April to December don't . I've tried add holidays seasonality , but the problems still. a Just like the red line in the above. If the yearly seasonality between January to March like that , the prophet's prediction works well. But I don't know how to adjust it except manually adjust. Like I said previously , the Spring Festival is drift year by year. so I think it would some what influence the history data fitting. And the next year's yearly seasonality between January to March would be wrong once again. Sincely hope you can help to solve this problem.

vhpietil commented 6 years ago

Have you tried external regressor? I think it might work in your problem.

la 20.1.2018 klo 11.07 zongyaoou notifications@github.com kirjoitti:

@bletham https://github.com/bletham Thanks for this awesome package . It really helps me a lot. But in my prediction , I have some problems just like @alex-municio https://github.com/alex-municio met . I'm a Chinese student , one of my study is to predict the number of every day's viewer in next month. The tough problems in my prediction is that the yearly seasonality of January to March is seriously base on the Spring Festival. It would drift year by year. But the seasonality of April to December don't . I've tried add holidays seasonality , but the problems still. [image: a] https://user-images.githubusercontent.com/28653771/35181727-5709ebf6-fe02-11e7-9c34-a66d160ac797.png Just like the red line in the above. If the yearly seasonality between January to March like that , the prophet's prediction works well. But I don't know how to adjust it except manually adjust. Like I said previously , the Spring Festival is drift year by year. so I think it would some what influence the history data fitting. And the next year's yearly seasonality between January to March would be wrong once again. Sincely hope you can help to solve this problem.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/facebook/prophet/issues/391#issuecomment-359157530, or mute the thread https://github.com/notifications/unsubscribe-auth/APOAAwZPzeL5YAQ9fF9RVxzEW7NPIV24ks5tMazJgaJpZM4RK-bZ .

zongyaoou commented 6 years ago

@vhpietil
Thanks for your suggestions :>
I've tried extra regressor , and adjust the prior scale , but the problem still there . if you prefer , I can send my data set and notebook to you , and we can discuss about how to solve it . Thanks for your suggresstions again.

vhpietil commented 6 years ago

@zongyaoou I can check your notebook and approach if u can share it and I find time :)

zongyaoou commented 6 years ago

@vhpietil
Thanks. I've upload my notebook and data set in my repository . https://github.com/zongyaoou/prophet You can see what I've done. Any suggestions would be appreciated .

bletham commented 6 years ago

That's a super interesting problem. The only thing I can think of right now is extremely ad-hoc, which would be to manually take that red curve and put it into a column that would be 0 on all dates outside the spring festival time, but then would take those values when it is inside the window. And you would properly center the curve on whatever the day is. So, this column for one year would look something like 0, 0, 0, 0, 1, 2, 5, .. 500, 400, ..., 0, 0, 0, ... and then you would repeat it for other years, but putting the non-zero portion so that it lines up properly with the date for that year. You would then use that column as an extra regressor. You might also then want to reduce the seasonality_prior_scale to make sure that it fits that part with the extra regressor and not with yearly seasonality. In the components plot you should see that bump disappear from the yearly seasonality plot and appear in the extra regressors plot. I'd expect that to work pretty well, but it does require constructing that portion of the seasonality curve manually.

zongyaoou commented 6 years ago

@bletham
Thanks for your solution. I've tried it , but the performence was seriouly base on my comprehention on the data set(that took me a lot of time to deeply comprehend after adjusted the window for many times). Finally , if the package can take this situation into concern and make out an algorithm in the future , it should be a significant improve(At least for me :> ).

jmccrosky commented 4 years ago

We would also find support for dynamic seasonality very valuable. I'm almost considering trying to play with it myself. Is anyone else interested in looking at this?