components: Extract components from a fitted model

Description Usage Arguments Details Examples

Description

Allows you to extract elements of interest from the model which can be useful in understanding how they contribute towards the overall fitted values.

Usage

1
2
3
4
5
## S3 method for class 'mdl_df'
components(object, ...)

## S3 method for class 'mdl_ts'
components(object, ...)

Arguments

object

A mable.

...

Other arguments passed to methods.

Details

A dable will be returned, which will allow you to easily plot the components and see the way in which components are combined to give forecasts.

Examples

1
2
3
4
5
6
7
8
library(fable)
library(tsibbledata)

# Forecasting with an ETS(M,Ad,A) model to Australian beer production
aus_production %>%
  model(ets = ETS(log(Beer) ~ error("M") + trend("Ad") + season("A"))) %>% 
  components() %>% 
  autoplot()

fabletools documentation built on Nov. 29, 2021, 9:08 a.m.