compute_rmse | R Documentation |
This function calculates the Root Mean Square Error (RMSE) between two numeric vectors (signals) and offers options for normalizing the RMSE.
compute_rmse(observed, predicted, normalise = "none")
observed |
A numeric vector of observed values (true values). |
predicted |
A numeric vector of predicted values (model values). |
normalise |
A character string specifying the normalization method. Options are "none", "max", "min", "range", "median", "mean" or "sd". Default is "none". |
A numeric value representing the normalised RMSE between the observed and predicted values.
# Example observed and predicted signals
observed <- c(1.0, 2.0, 3.0, 4.0, 5.0)
predicted <- c(1.1, 2.1, 2.9, 4.2, 5.0)
# Compute RMSE without normalization
rmse_no_norm <- compute_rmse(observed, predicted, normalise = "none")
print(rmse_no_norm)
# Compute RMSE normalised by the max value of the observed signal
rmse_max <- compute_rmse(observed, predicted, normalise = "max")
print(rmse_max)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.