Learn R Programming

fable.prophet (version 0.1.0)

components.fbl_prophet: Extract meaningful components

Description

A prophet model consists of terms which are additively or multiplicatively included in the model. Multiplicative terms are scaled proportionally to the estimated trend, while additive terms are not.

Usage

# S3 method for fbl_prophet
components(object, ...)

Arguments

object

An estimated model.

...

Unused.

Value

A fabletools::dable() containing estimated states.

Details

Extracting a prophet model's components using this function allows you to visualise the components in a similar way to prophet::prophet_plot_components().

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
if (requireNamespace("tsibbledata")) {
library(tsibble)
beer_components <- tsibbledata::aus_production %>%
  model(
    prophet = prophet(Beer ~ season("year", 4, type = "multiplicative"))
  ) %>%
  components()

beer_components

autoplot(beer_components)

library(ggplot2)
library(lubridate)
beer_components %>%
  ggplot(aes(x = quarter(Quarter), y = year, group = year(Quarter))) +
  geom_line()
}
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab