weighted_rmse {babsim.hospital}R Documentation

weighted_rmse

Description

Calculate a weighted RMSE. Weights are based on 'time' in the case of the weights variable. (E.g. older errors weigh less). And also based on the 'direction' e.g. predicting to few used ressources is worse than predicting a few ressources used too much.

Usage

weighted_rmse(
  actual,
  predicted,
  weights = exp(-(length(actual):1)/14),
  worsenGoodExpections = 1.5
)

Arguments

actual

Real Data, vector of observations

predicted

Predicted Data, vector of observations

weights

Time based decay. Default is an exponential decay

worsenGoodExpections

Factor by how much predicting too few used ressources should be punished more.

Value

weighted RMSE


[Package babsim.hospital version 11.8.4 Index]