R/wmape.R

Defines functions wmape

Documented in wmape

# WMAPE

#' @title Weighted Mean Absolute Percentage Error
#' @description Calculates Weighted Mean Absolute Percentage Error
#' @param observed the observed results
#' @param predicted the predicted results
#' @return Calculated WMAPE result
#' @export
#'

wmape <- function(observed,
                  predicted){
  res = sum(abs(observed-predicted))/sum(observed)
  res = res * 100
  return(res)
}
canhakan/canhakan1 documentation built on Dec. 19, 2021, 1:48 p.m.