Skip to contents

Produces forecasts from a trained model.

Usage

# S3 method for LOGISTIC
forecast(
  object,
  new_data,
  specials = NULL,
  simulate = 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()).

simulate

If TRUE, then forecast distributions are computed using simulation from a Bernoulli model.

times

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

...

Other arguments passed to methods

Examples

melb_rain |>
  model(logistic = LOGISTIC(Wet ~ fourier(K = 5, period = "year"))) |>
  forecast(h = "2 years")
#> # A fable: 730 x 4 [1D]
#> # Key:     .model [1]
#>    .model   Date              Wet .mean
#>    <chr>    <date>         <dist> <dbl>
#>  1 logistic 2011-11-01 B(1, 0.41) 0.413
#>  2 logistic 2011-11-02 B(1, 0.41) 0.412
#>  3 logistic 2011-11-03 B(1, 0.41) 0.411
#>  4 logistic 2011-11-04 B(1, 0.41) 0.410
#>  5 logistic 2011-11-05 B(1, 0.41) 0.409
#>  6 logistic 2011-11-06 B(1, 0.41) 0.408
#>  7 logistic 2011-11-07 B(1, 0.41) 0.407
#>  8 logistic 2011-11-08 B(1, 0.41) 0.405
#>  9 logistic 2011-11-09  B(1, 0.4) 0.404
#> 10 logistic 2011-11-10  B(1, 0.4) 0.402
#> # ℹ 720 more rows