First of all, thanks for opensourcing such an awesome library!
From a distant and probably incomplete look it seems to be relatively easy to add external time series regressor to Prophet's GAM in analogy to ARIMAX models (http://robjhyndman.com/hyndsight/arimax/). This would be a very handy feature to have.
Do external regressors make sense in Prophet's mathematical framework?
Yes it would be very straightforward to add external regressors. The only real practical challenge is that you would need to have a forecast for the external regressors before using them to forecast the time series.
Hi @bletham and @kernelmode ,
May I ask how this task is going ? If it is possible, I want to try add bayesian linear regression for exogenous variable, spike and slab method like Bayesian structured time series model. Can I participate this task with the above approach ?
I expect external regressors to be done within the next week.
https://github.com/facebookincubator/prophet/commit/8f1607cd93d4641d690d95c5f4dd2737e8e7152f adds this in Python. See the bottom of https://github.com/facebookincubator/prophet/blob/v0.2/notebooks/seasonality_and_holiday_effects.ipynb for an example. If you have a use-case for external regressors, please install the v0.2 branch and try it out.
If someone would like to translate this commit into the R version and make a PR for it let me know, or I'll get to it next week.
@bletham awesome !!! I will translate this commit into the R and make a PR !!!
nice work @bletham, does this mean that by using "add_regressors" function we can now incorporate multiple features to predict a response variable ?
That is correct. The model is trend + X * beta , so the piecewise trend plus a linear component. Currently X contains features for modeling seasonality and indicator vectors for identifying holidays. The add_regressors function allows you to add whatever column to X you would like, so you can include any additional features in the linear component of the model.
@sukwkim @bletham I have problems running the v0.2 branch in python, is add_regressor available in R ?
Not yet on my end, @sukwkim ?
sorry for delay @anandgavai @bletham . I will add it within next week !
What is the status of this for R? I see the note by @sukwkim but no updates to prophet available. Is this just on the github perhaps?
@cdeterman Apologies, due to some personal issues, I kept delaying this. I promise I will finish it by this week.!!
This is available in the v0.2 release now on CRAN and pypi. Documentation is here:
https://facebookincubator.github.io/prophet/docs/seasonality_and_holiday_effects.html
If you have issues with it feel free to post here or open a new issue.
Dear all,
Does Prophet accept categorical regressors? Does it encode the regressors (e.g. one-hot) or do they need to be encoded?
Thanks
Extra regressors are just added directly as a feature to the linear part of the model (columns of X in X*beta). You will need to one-hot encode them yourself.
@bletham I see. Thanks!
Can Prophet work for multivariate time series,using external regressors
Hi!
Can someone please point me to a working example of multivariate time series forecasting with fbprophet?
Thanks!
@porvakanti Prophet doesn't support multivariate forecasting. You'll have to predict each variable on its own.
Most helpful comment
https://github.com/facebookincubator/prophet/commit/8f1607cd93d4641d690d95c5f4dd2737e8e7152f adds this in Python. See the bottom of https://github.com/facebookincubator/prophet/blob/v0.2/notebooks/seasonality_and_holiday_effects.ipynb for an example. If you have a use-case for external regressors, please install the v0.2 branch and try it out.
If someone would like to translate this commit into the R version and make a PR for it let me know, or I'll get to it next week.