calcrmse: calcrmse calcuates the root mean square error for two vectors

View source: R/datalow_utils.r

calcrmseR Documentation

calcrmse calcuates the root mean square error for two vectors

Description

given a set of observations and predicted values, calcrmse calculates the root mean square error sqrt(resid^2/n) to provide a measure of relative fit. An assumption of normal errors is made so if the observations and predicted values actually have a log-normal distribution one should log-transform the input values.

Usage

calcrmse(obs, pred)

Arguments

obs

the observed data

pred

the predicted values whose fit to the observations is to measured

Value

a scalar value which is the rmse.

Examples

## Not run: 
x <- rep(1,10)
y <- c(1.109,1.210,0.947,0.933,0.832,0.864,0.633,0.820,1.004,1.049)
calcrmse(log(x),log(y))  # should be 0.1899495

## End(Not run)

haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.