mape: mape

Description Usage Arguments Details Value See Also Examples

View source: R/mape.R

Description

Mean Absolute Percent Error (MAPE).

Usage

1
mape(x, na.rm = TRUE)

Arguments

x

A vector of class numeric.

na.rm

Logical. Should the NA values be excluded. Default is TRUE.

Details

Estimates the Mean Absolute Percent Error (MAPE) for a given vector. The MAPE compares the individual values against their mean and translates the mean of the differences into a percent deviation from the mean of the vector. The MAPE is estimated as:

100 / length(x) * sum(abs((x-mean(x))/x))

Value

A numeric element.

See Also

relative.freq ccLabel

Examples

1
2
3
4
5
6
{

x <- c(0.1, 0.3, 0.4, 0.1, 0.2, 0.6)
m <- mape(x)

}

RRemelgado/fieldRS documentation built on June 5, 2020, 1:48 p.m.