Adding extra regressor in Prophet

这一生的挚爱 提交于 2020-02-06 15:46:27

问题


I hope I'll find a way to ask a question. I have data of a store's income with a 3-4 year history. My goal is to forecast next two months. I'm trying to achieve this with prophet, and so far it's going well. I have a regressor I want to use to improve my forecast but I'm not sure how to use it the best way I can. My regresor is different levels of impact on the stores income where 1 equals no impact, and 1,20 for example equals, 20 percent increase on that day. 0,8 would mean that there would be 20 percent decrease on income. How could I fit that kind of information in the best way to my model?

Thank you in advance.


回答1:


Should be straight forward. You'd use the add_regressors() function, documented here (https://facebook.github.io/prophet/docs/seasonality_and_holiday_effects.html). If you have your regression term (a column say 'impact') at the same time series level, you'd add it (in R) by doing:

m <- prophet()
add_regressor(m = m, 
              name = 'impact')
m <- fit.prophet(m = m, df = <your_dataframe_here>)


来源:https://stackoverflow.com/questions/49409043/adding-extra-regressor-in-prophet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!