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 class 'VECM'
generate(x, new_data, specials, ...)
A fitted model.
A tsibble containing the time points and exogenous regressors to produce forecasts for.
(passed by fabletools::forecast.mdl_df()
).
Other arguments passed to methods
as_tsibble(USAccDeaths) %>%
model(ETS(log(value) ~ season("A"))) %>%
generate(times = 100)
#> # A tsibble: 2,400 x 4 [1M]
#> # Key: .model, .rep [100]
#> .model index .rep .sim
#> <chr> <mth> <chr> <dbl>
#> 1 "ETS(log(value) ~ season(\"A\"))" 1979 Jan 1 7769.
#> 2 "ETS(log(value) ~ season(\"A\"))" 1979 Feb 1 6972.
#> 3 "ETS(log(value) ~ season(\"A\"))" 1979 Mar 1 7876.
#> 4 "ETS(log(value) ~ season(\"A\"))" 1979 Apr 1 8235.
#> 5 "ETS(log(value) ~ season(\"A\"))" 1979 May 1 9091.
#> 6 "ETS(log(value) ~ season(\"A\"))" 1979 Jun 1 9577.
#> 7 "ETS(log(value) ~ season(\"A\"))" 1979 Jul 1 11152.
#> 8 "ETS(log(value) ~ season(\"A\"))" 1979 Aug 1 9954.
#> 9 "ETS(log(value) ~ season(\"A\"))" 1979 Sep 1 8576.
#> 10 "ETS(log(value) ~ season(\"A\"))" 1979 Oct 1 9036.
#> # ℹ 2,390 more rows