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 'ARIMA'
generate(x, new_data, specials, bootstrap = FALSE, ...)

Arguments

x

A fitted model.

new_data

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

specials

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

bootstrap

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

...

Other arguments passed to methods

Examples

fable_fit <- as_tsibble(USAccDeaths) %>%
  model(model = ARIMA(value ~ 0 + pdq(0,1,1) + PDQ(0,1,1)))
fable_fit %>% generate(times = 10)
#> # A tsibble: 240 x 4 [1M]
#> # Key:       .model, .rep [10]
#>    .model    index .rep    .sim
#>    <chr>     <mth> <chr>  <dbl>
#>  1 model  1979 Jan 1      8205.
#>  2 model  1979 Feb 1      7757.
#>  3 model  1979 Mar 1      9001.
#>  4 model  1979 Apr 1      8823.
#>  5 model  1979 May 1      9795.
#>  6 model  1979 Jun 1     10817.
#>  7 model  1979 Jul 1     11154.
#>  8 model  1979 Aug 1     10890.
#>  9 model  1979 Sep 1      9743.
#> 10 model  1979 Oct 1      9869.
#> # ℹ 230 more rows