Time series decomposition using prophet
See original GitHub issueHi Devs,
I have a use case of decomposing a time series using the prophet. I know that internally prophet decomposes the time series into seasonal, trend and holiday components. But I couldn’t find a way to extract the components of a fitted prophet model ( You can achieve this in the famous forecast package, by invoking the tbats.components(model), once a tbats model is being fitted, assuming you are fitting a tbats model)
The only available API in the prophet package is the prophet_plot_components(), which only provides the component decomposition of the predicted values. Following is an excerpt of my code, which I use to extract the components of the predicted values.
m <- prophet(history)
forecast_prophet <- predict(m,future)
forecast_prophet$daily
forecast_prophet$weekly
forecast_prophet$trend
Is there any API available in prophet to extract the components in a fitted model of Prophet, which is m in this case?
Thanks in advance. Kasun.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Related StackOverflow Question
Ah, I see. If you call
predict()without passing in a dataframe, then it will make a “prediction” on the history, which sounds like what you’re looking for.Yes, there’s actually an example in the documentation with a time series with 5 minute intervals: https://facebook.github.io/prophet/docs/non-daily_data.html#sub-daily-data
“daily” seasonality means a periodic cycle that lasts one day, which is useful for sub-daily data. If there are cycles that are faster than that in your time series, you could specify them as custom seasonalities as described here: https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#specifying-custom-seasonalities