Learn R Programming

MLSP (version 0.1.0)

msd.comp: Compute Model Evaluation Metrics

Description

This function computes various statistics for comparing observed values `y` with predicted values `yhat`. It includes correlation, regression coefficients, bias, RMSE, MSE, and predictive performance metrics like RPD and RPIQ.

Usage

msd.comp(y, yhat)

Value

A named numeric vector with the following components:

r

Pearson correlation between `y` and `yhat`

int

Intercept of regression of `y` on `yhat`

slope

Slope of regression of `y` on `yhat`

r2

Coefficient of determination (R-squared)

bias

Mean bias: mean(yhat) - mean(y)

rmse

Root mean squared error

mse

Mean squared error

sb

Systematic bias component of MSE

nu

Non-unity slope component of MSE

lc

Lack-of-correlation component of MSE

rmse.c

Corrected RMSE after removing bias

mse.c

Corrected MSE after removing bias

rpd

Ratio of standard deviation to RMSE (RPD)

rpiq

Ratio of interquartile range to RMSE (RPIQ)

Arguments

y

Numeric vector of observed values.

yhat

Numeric vector of predicted values (same length as `y`).

Examples

Run this code
# \donttest{
y_obs <- c(1.2, 3.4, 2.5, 4.1)
y_pred <- c(1.1, 3.5, 2.4, 4.0)
msd.comp(y_obs, y_pred)
# }

Run the code above in your browser using DataLab