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 .mean #> <chr> <mth> <dist> <dbl> #> 1 ets 1979 Jan t(N(9, 0.0011)) 8296. #> 2 ets 1979 Feb t(N(8.9, 0.0014)) 7524. #> 3 ets 1979 Mar t(N(9, 0.0018)) 8366. #> 4 ets 1979 Apr t(N(9.1, 0.0022)) 8622. #> 5 ets 1979 May t(N(9.2, 0.0026)) 9532. #> 6 ets 1979 Jun t(N(9.2, 0.003)) 10049. #> 7 ets 1979 Jul t(N(9.3, 0.0035)) 10976. #> 8 ets 1979 Aug t(N(9.2, 0.004)) 10252. #> 9 ets 1979 Sep t(N(9.1, 0.0045)) 9169. #> 10 ets 1979 Oct t(N(9.2, 0.005)) 9499. #> # … with 14 more rows