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 2, 2019, 2:17 a.m.