Applies a fitted ETS model to a new dataset.

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

Arguments

object

The time series model used to produce the forecasts

new_data

A tsibble containing future information used to forecast.

specials

(passed by fablelite::forecast.mdl_df()).

reestimate

If TRUE, the coefficients for the fitted model will be re-estimated to suit the new data.

reinitialise

If TRUE, the initial parameters will be re-estimated to suit the new data.

...

Additional arguments for forecast model methods.

Examples

lung_deaths_male <- as_tsibble(mdeaths) lung_deaths_female <- as_tsibble(fdeaths) fit <- lung_deaths_male %>% model(ETS(value)) report(fit)
#> 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
fit %>% refit(lung_deaths_female, reinitialise = TRUE) %>% report()
#> 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