Applies a fitted random walk model to a new dataset.

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

Arguments

object

A model for which forecasts are required.

new_data

A tsibble containing the time points and exogenous regressors to produce forecasts for.

specials

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

reestimate

If TRUE, the lag walk model will be re-estimated to suit the new data.

...

Other arguments passed to methods

Details

The models NAIVE and SNAIVE have no specific model parameters. Using refit for one of these models will provide the same estimation results as one would use fabletools::model(NAIVE(...)) (or fabletools::model(SNAIVE(...)).

Examples

lung_deaths_male <- as_tsibble(mdeaths)
lung_deaths_female <- as_tsibble(fdeaths)

fit <- lung_deaths_male %>%
  model(RW(value ~ drift()))

report(fit)
#> Series: value 
#> Model: RW w/ drift 
#> 
#> Drift: -11.169 (se: 34.8392)
#> sigma^2: 86177.8853 

fit %>%
  refit(lung_deaths_female) %>%
  report()
#> Series: value 
#> Model: RW w/ drift 
#> 
#> Drift: -11.169 (se: 34.8392)
#> sigma^2: 16043.6423