Applies a fitted average method model to a new dataset.
# S3 method for class 'model_mean'
refit(object, new_data, specials = NULL, reestimate = FALSE, ...)
A model for which forecasts are required.
A tsibble containing the time points and exogenous regressors to produce forecasts for.
(passed by fabletools::forecast.mdl_df()
).
If TRUE
, the mean for the fitted model will be re-estimated
to suit the new data.
Other arguments passed to methods
lung_deaths_male <- as_tsibble(mdeaths)
lung_deaths_female <- as_tsibble(fdeaths)
fit <- lung_deaths_male %>%
model(MEAN(value))
report(fit)
#> Series: value
#> Model: MEAN
#>
#> Mean: 1495.9444
#> sigma^2: 187619.7152
fit %>%
refit(lung_deaths_female) %>%
report()
#> Series: value
#> Model: MEAN
#>
#> Mean: 1495.9444
#> sigma^2: 32299.2909