Learn R Programming

fasster (version 0.2.0)

components.FASSTER: Extract Components from a FASSTER Model

Description

Decomposes a FASSTER model into its individual components, allowing you to examine the contribution of each term to the fitted values. This is useful for understanding which components drive the model's predictions and how well different aspects of the model fit the data.

Usage

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

Value

A dable (decomposition table) containing the response variable and each model component as separate columns. The components sum to the response variable.

Arguments

object

A FASSTER model object.

...

Additional arguments (currently unused).

Examples

Run this code
if (requireNamespace("tsibbledata", quietly = TRUE)) {
# Fit a FASSTER model and extract components
library(tsibble)
library(dplyr)
fit <- tsibbledata::aus_retail |>
  filter(
    State == "Victoria",
    Industry == "Cafes, restaurants and catering services"
  ) |>
  model(fasster = FASSTER(Turnover ~ trend(1) + season("year")))

# Extract and view components
components(fit)
}

Run the code above in your browser using DataLab