Simulates future paths from a dataset using a fitted model. Innovations are sampled by the model's assumed error distribution. If bootstrap is TRUE, innovations will be sampled from the model's residuals. If new_data contains the .innov column, those values will be treated as innovations.

# S3 method for ETS
generate(x, new_data, specials, bootstrap = FALSE, ...)

Arguments

x

A fitted model.

new_data

A tsibble containing future information used to forecast.

specials

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

bootstrap

If TRUE, then forecast distributions are computed using simulation with resampled errors.

...

Additional arguments for forecast model methods.

See also

Examples

as_tsibble(USAccDeaths) %>% model(ETS(log(value) ~ season("A"))) %>% generate(times = 100)
#> # A tsibble: 2,400 x 4 [1M] #> # Key: .model, .rep [100] #> .model .rep index .sim #> <chr> <int> <mth> <dbl> #> 1 "ETS(log(value) ~ season(\"A\"))" 1 1979 Jan 8247. #> 2 "ETS(log(value) ~ season(\"A\"))" 1 1979 Feb 7294. #> 3 "ETS(log(value) ~ season(\"A\"))" 1 1979 Mar 8733. #> 4 "ETS(log(value) ~ season(\"A\"))" 1 1979 Apr 8971. #> 5 "ETS(log(value) ~ season(\"A\"))" 1 1979 May 10132. #> 6 "ETS(log(value) ~ season(\"A\"))" 1 1979 Jun 11007. #> 7 "ETS(log(value) ~ season(\"A\"))" 1 1979 Jul 11379. #> 8 "ETS(log(value) ~ season(\"A\"))" 1 1979 Aug 11017. #> 9 "ETS(log(value) ~ season(\"A\"))" 1 1979 Sep 9317. #> 10 "ETS(log(value) ~ season(\"A\"))" 1 1979 Oct 10403. #> # … with 2,390 more rows