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 = ""
)A fitted model object from fit_baseline()
Interval method object (NoInterval, EmpiricalInterval, etc.)
Integer or vector of integers specifying forecast horizons
Numeric vector of confidence levels (default: 0.95)
Whether to include median forecast (default: TRUE)
Optional vector of true values for evaluation
Optional name for the model
A Forecast object (list) containing forecasts and metadata
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, ...)
)
} # }