R/nrmse.R

Defines functions nrmse

Documented in nrmse

#' Computes the normalized root mean squared error
#' 
#' @export
#' @param obs observed vector, matrix or data.frame
#' @param pred predicted vector, matrix or data.frame
#' 
#' @return numeric value of the root mean squared error normalized to the standard deviation
#' of the observed data

nrmse <- function(obs, pred) {
  sqrt( mean((obs-pred)^2, na.rm=T) / mean((obs-mean(obs, na.rm=T))^2, na.rm=T) )
}

Try the BaTFLED3D package in your browser

Any scripts or data that you put into this service are public.

BaTFLED3D documentation built on May 2, 2019, 2:38 p.m.