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

# 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

if (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) }
#> Series: value #> Model: ETS(M,A,A) #> Smoothing parameters: #> alpha = 0.0002065548 #> beta = 0.0001865257 #> gamma = 0.000118306 #> #> Initial states: #> l b s1 s2 s3 s4 s5 s6 #> 1671.676 -4.334248 373.1746 -121.3157 -246.1697 -484.8581 -476.2192 -370.1939 #> s7 s8 s9 s10 s11 s12 #> -303.5806 -207.384 122.0022 483.3319 620.3601 610.8525 #> #> sigma^2: 0.009 #> #> AIC AICc BIC #> 1033.474 1044.807 1072.177 #> Series: value #> Model: ETS(M,A,A) #> Smoothing parameters: #> alpha = 0.0002065548 #> beta = 0.0001865257 #> gamma = 0.000118306 #> #> Initial states: #> l b s1 s2 s3 s4 s5 s6 #> 586.8764 -0.7008449 129.4235 -60.401 -108.8126 -185.465 -189.2346 -149.2135 #> s7 s8 s9 s10 s11 s12 #> -134.8698 -70.64105 45.28081 204.0216 279.4489 240.4628 #> #> sigma^2: 0.0118 #> #> AIC AICc BIC #> 903.5169 910.8854 935.3903