Time series decomposition using prophet

See original GitHub issue

Hi 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
blethamcommented, Mar 7, 2019

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.

1reaction
blethamcommented, Mar 12, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trend and seasonality decomposition with Prophet
Prophet uses a decomposable time series model consisting of: trend, seasonal effects and holiday effects. This article focus only the trend and seasonality:...
Read more >
Decomposing time series using Facebook's Prophet
Decomposing time series using Facebook's Prophet. An alternative approach to time series decomposition is to use an additive model, in which a time...
Read more >
Prophet | Forecasting at scale. - Meta Open Source
Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, ...
Read more >
Time Series Analysis with Facebook Prophet: How it works ...
Facebook Prophet is an open-source algorithm for generating time-series models that uses a few old ideas with some new twists.
Read more >
Time Series Forecasting Of Bitcoin Prices Using Prophet
Prophet is a Python time series forecast library developed by Facebook. Prophet automatically detects yearly, weekly, and daily seasonality.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found