mpe: MPE

Description Usage Arguments Value Examples

Description

Calculates the Mean Percentage Error(MPE) between x and the target.

Usage

1
mpe(x, target, na.rm = FALSE)

Arguments

x

numeric vector

target

numeric vector

na.rm

logical; should NAs be removed before calculation?

Value

An atomic numeric vector containing the calculated MPE

Examples

1
2
3
4
5
6
## Not run: mpe(c(1, 2, 3))            #> Error: different lengths (3, 0)
mpe(c(1, 2, 3), c(1, 4, 4))          #> 25.0
mpe(c(1, 2, NA, 4), c(2, 2, 5, NA))  #> NA
mpe(c(1, 2, NA, 4),
    c(2, 2, 5, NA),
    na.rm = TRUE)                    #> 12.5

max-graham/metrics documentation built on May 5, 2019, 5:53 p.m.