compute_rmse: Compute Root Mean Square Error (RMSE) with Normalization...

View source: R/compute_rmse.R

compute_rmseR Documentation

Compute Root Mean Square Error (RMSE) with Normalization Options (untested)

Description

This function calculates the Root Mean Square Error (RMSE) between two numeric vectors (signals) and offers options for normalizing the RMSE.

Usage

compute_rmse(observed, predicted, normalise = "none")

Arguments

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".

Value

A numeric value representing the normalised RMSE between the observed and predicted values.

Examples

# 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)

Kneerav/biomechanics documentation built on March 30, 2025, 12:56 a.m.