Produces forecasts from a trained model.

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

Arguments

object

A model for which forecasts are required.

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.

times

The number of sample paths to use in estimating the forecast distribution when bootstrap = TRUE.

...

Other arguments passed to methods

Value

A list of forecasts.

Examples

USAccDeaths %>%
  as_tsibble() %>%
  model(arima = ARIMA(log(value) ~ pdq(0, 1, 1) + PDQ(0, 1, 1))) %>%
  forecast()
#> # A fable: 24 x 4 [1M]
#> # Key:     .model [1]
#>    .model    index             value  .mean
#>    <chr>     <mth>            <dist>  <dbl>
#>  1 arima  1979 Jan   t(N(9, 0.0014))  8290.
#>  2 arima  1979 Feb t(N(8.9, 0.0018))  7453.
#>  3 arima  1979 Mar   t(N(9, 0.0022))  8276.
#>  4 arima  1979 Apr t(N(9.1, 0.0025))  8584.
#>  5 arima  1979 May t(N(9.2, 0.0029))  9499.
#>  6 arima  1979 Jun t(N(9.2, 0.0033))  9900.
#>  7 arima  1979 Jul t(N(9.3, 0.0037)) 10988.
#>  8 arima  1979 Aug t(N(9.2, 0.0041)) 10132.
#>  9 arima  1979 Sep t(N(9.1, 0.0045))  9138.
#> 10 arima  1979 Oct t(N(9.1, 0.0049))  9391.
#> # ℹ 14 more rows