Generates a complete forecast including point forecasts, prediction intervals, and optionally trajectories.

forecast(
  fitted,
  interval_method = NoInterval(),
  horizon = 1L,
  levels = 0.95,
  include_median = TRUE,
  truth = NULL,
  model_name = ""
)

Arguments

fitted

A fitted model object from fit_baseline()

interval_method

Interval method object (NoInterval, EmpiricalInterval, etc.)

horizon

Integer or vector of integers specifying forecast horizons

levels

Numeric vector of confidence levels (default: 0.95)

include_median

Whether to include median forecast (default: TRUE)

truth

Optional vector of true values for evaluation

model_name

Optional name for the model

Value

A Forecast object (list) containing forecasts and metadata

Examples

if (FALSE) { # \dontrun{
# Point forecast only
fc <- forecast(fitted, interval_method = NoInterval(), horizon = 1:12)

# With prediction intervals
fc <- forecast(fitted,
  interval_method = EmpiricalInterval(n_trajectories = 1000),
  horizon = 1:12,
  levels = c(0.80, 0.95)
)

# With truth for evaluation
fc <- forecast(fitted,
  interval_method = EmpiricalInterval(),
  horizon = 1:12,
  truth = c(3.6, 3.8, 4.1, ...)
)
} # }