Learn R Programming

fable (version 0.3.2)

forecast.croston: Forecast a model from the fable package

Description

Produces forecasts from a trained model.

Usage

# S3 method for croston
forecast(object, new_data, specials = NULL, ...)

Value

A list of forecasts.

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()).

...

Additional arguments for forecast model methods.

Examples

Run this code
library(tsibble)
sim_poisson <- tsibble(
  time = yearmonth("2012 Dec") + seq_len(24),
  count = rpois(24, lambda = 0.3),
  index = time
)

sim_poisson %>%
  model(CROSTON(count)) %>%
  forecast()

Run the code above in your browser using DataLab