Learn R Programming

fasster (version 0.2.0)

refit.FASSTER: Refit a FASSTER model

Description

Applies a fitted FASSTER model to a new dataset.

Usage

# S3 method for FASSTER
refit(object, new_data, specials = NULL, reestimate = FALSE, ...)

Value

A refitted FASSTER model.

Arguments

object

A fitted FASSTER model.

new_data

A tsibble containing the new data.

specials

(passed by fabletools::refit.mdl_df()).

reestimate

If TRUE, the model parameters will be re-estimated to suit the new data using the heuristic approach. If FALSE, the existing model structure and parameters are applied to the new data without modification.

...

Additional arguments passed to the training function.

Examples

Run this code
library(tsibble)

# Fit model to male deaths
fit_male <- as_tsibble(mdeaths) |>
  model(FASSTER(value ~ trend(1) + fourier(12)))

# Refit to female deaths without re-estimating parameters
refit(fit_male, as_tsibble(fdeaths), reestimate = FALSE)

# Refit to female deaths with re-estimated parameters
refit(fit_male, as_tsibble(fdeaths), reestimate = TRUE)

Run the code above in your browser using DataLab