components.fbl_prophet: Extract meaningful components

Description Usage Arguments Details Value Examples

View source: R/model.R

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

1
2
## S3 method for class 'fbl_prophet'
components(object, ...)

Arguments

object

An estimated model.

...

Unused.

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().

Value

A fabletools::dable() containing estimated states.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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()
}

fable.prophet documentation built on Aug. 20, 2020, 5:06 p.m.