Learn R Programming

fabletools (version 0.5.0)

refit.mdl_df: Refit a mable to a new dataset

Description

Applies a fitted model to a new dataset. For most methods this can be done with or without re-estimation of the parameters.

Usage

# S3 method for mdl_df
refit(object, new_data, ...)

# S3 method for mdl_ts refit(object, new_data, ...)

Arguments

object

A mable.

new_data

A tsibble dataset used to refit the model.

...

Additional optional arguments for refit methods.

Examples

Run this code
if (FALSE) { # requireNamespace("fable", quietly = TRUE)
library(fable)

fit <- as_tsibble(mdeaths) %>% 
  model(ETS(value ~ error("M") + trend("A") + season("A")))
fit %>% report()

fit %>% 
  refit(as_tsibble(fdeaths)) %>% 
  report(reinitialise = TRUE)
}

Run the code above in your browser using DataLab