R/RMSE.R

Defines functions RMSE

Documented in RMSE

#' Root Mean Squared Error
#'
#' Root Mean Squared Error.
#' @param x,y Two vectors of the same length.
#' @keywords root mean squared error
#' @export RMSE
#' @examples
#' x = runif(10)
#' y = runif(10)
#' RMSE(x,y)

RMSE = function(x,y){
  n = length(x)
  rmse = sqrt(1/n * sum((x-y)^2))
  return(rmse)
}

Try the staTools package in your browser

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

staTools documentation built on May 2, 2019, 2:17 a.m.