components.fbl_bsts: Extract meaningful components

Description Usage Arguments Details Value Examples

View source: R/model.R

Description

A bsts model consists of terms which are additively included in the model.

Usage

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

Arguments

object

An estimated model.

...

Unused.

Details

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

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
19
20
21
22
if (requireNamespace("tsibbledata")) {
library(tsibble)
library(dplyr)
beer_components <- tsibbledata::aus_production %>%
  model(
    bsts = BSTS(Beer ~ season("year"))
  ) %>%
  components()

beer_components

## Not run: 
autoplot(beer_components)

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

## End(Not run)
}

davidtedfordholt/fable.bsts documentation built on Sept. 15, 2020, 11:38 a.m.