This function calculates various error metrics for a given prediction object.

geterror(obj, actual, level = 95)

Arguments

obj

A prediction object containing mean predictions and intervals.

actual

A numeric vector of actual values.

level

The confidence level for the prediction intervals.

Value

A numeric vector containing the error metrics.

Examples


obj <- list(mean = 10, lower = 8, upper = 12)
actual <- 11
geterror(obj, actual)
#>           me         rmse          mae          mpe         mape     coverage 
#>  -1.00000000   1.00000000   1.00000000  -0.09090909   0.09090909 100.00000000 
#>      winkler 
#>   4.00000000