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

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

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



A mable.


Other arguments passed to methods.


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.


if (requireNamespace("fable", quietly = TRUE)) { 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() }
#> Warning: 1 error encountered for ets #> [1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
#> Error: `mutate()` argument `cmp` errored. #> `cmp` is `map(.fit, components)`. #> no applicable method for 'components' applied to an object of class "null_mdl"