Produces forecasts from a trained model.

# S3 method for ETS
forecast(object, new_data, specials = NULL,
  simulate = FALSE, bootstrap = FALSE, times = 5000, ...)

Arguments

object

The time series model used to produce the forecasts

new_data

A tsibble containing future information used to forecast.

specials

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

simulate

If TRUE, prediction intervals are produced by simulation rather than using analytic formulae.

bootstrap

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

times

The number of sample paths to use in estimating the forecast distribution if simulated intervals are used.

...

Additional arguments for forecast model methods.

Value

A list of forecasts.

Examples

as_tsibble(USAccDeaths) %>% model(ets = ETS(log(value) ~ season("A"))) %>% forecast()
#> # A fable: 24 x 4 [1M] #> # Key: .model [1] #> .model index value .distribution #> <chr> <mth> <dbl> <dist> #> 1 ets 1979 Jan 8296. t(N(9.0, 0.0011)) #> 2 ets 1979 Feb 7524. t(N(8.9, 0.0014)) #> 3 ets 1979 Mar 8366. t(N(9.0, 0.0018)) #> 4 ets 1979 Apr 8622. t(N(9.1, 0.0022)) #> 5 ets 1979 May 9532. t(N(9.2, 0.0026)) #> 6 ets 1979 Jun 10049. t(N(9.2, 0.0030)) #> 7 ets 1979 Jul 10976. t(N(9.3, 0.0035)) #> 8 ets 1979 Aug 10252. t(N(9.2, 0.0040)) #> 9 ets 1979 Sep 9169. t(N(9.1, 0.0045)) #> 10 ets 1979 Oct 9499. t(N(9.2, 0.0050)) #> # … with 14 more rows