R/MPE.R

Defines functions MPE

Documented in MPE

#' Mean Percentage Error
#'
#' Mean Percentage Error.
#' @param x,y Two vectors of the same length.
#' @keywords mean percentage error
#' @export MPE
#' @examples
#' x = runif(10)
#' y = runif(10)
#' MPE(x,y)

MPE = function(x,y){
  n = length(x)
  mpe = 100/n * sum((x-y)/x)
  return(mpe)
}

Try the staTools package in your browser

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

staTools documentation built on May 29, 2017, 3:36 p.m.