This function prints the forecasts contained in a koma_forecast object as
a multivariate time series (mts). Users can specify which variables to print
and select either the mean forecast, the median forecast, or specific
quantiles of the forecast distribution.
Usage
# S3 method for class 'koma_forecast'
print(x, ..., variables = NULL, central_tendency = NULL, digits = 4)Arguments
- x
A
koma_forecastobject.- ...
Additional parameters.
- variables
Optional. A character vector of variable names to print. Default is NULL, which prints all forecasted variables.
- central_tendency
Optional. A string specifying the type of forecast to print. Can be "mean", "median", or a quantile name like "q_5", "q_50", "q_95". Default is "mean" if available, otherwise "median", or a specified quantile.
- digits
Optional. Integer number of decimal digits to round the printed output. Default is 4.
Value
Invisibly returns x, the original koma_forecast object (a list
of koma_ts objects, one per forecasted variable). Called primarily for
its side effect of printing the selected forecast as a multivariate time
series (mts) to the console.
Details
This function prints the forecasts contained in a koma_forecast object.
Users can choose to print either the mean forecast, the median forecast, or
specific quantiles of the forecast distribution.
If variables is specified, only the forecasts for those variables are
printed.
If central_tendency is not specified, the function defaults to printing the
mean forecast if available, otherwise the median forecast, or a specified
quantile.
Printing converts the selected forecast list to an mts for readability; the
underlying koma_forecast object remains a list of koma_ts.