compute.nmae: Normalized Mean Absolute Error (NMAE)

Description Usage Arguments Details Author(s) Examples

Description

Estimates the Normalized Mean Absolute Error of two univariate signals Y (imputed values) and X (true values).

Usage

1

Arguments

Y

vector of imputed values

X

vector of true values

Details

This function returns the value of NMAE of two vectors corresponding to univariate signals. A lower NMAE (NMAE \in [0, \inf]) value indicates a better performance method for the imputation task. Both vectors Y and X must be of equal length, on the contrary an error will be displayed. In both input vectors, eventual NA will be exluded with a warning diplayed.

Author(s)

Camille Dezecache, Hong T. T. Phan, Emilie Poisson-Caillault

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(dataDTWBI)
X <- dataDTWBI[, 1] ; Y <- dataDTWBI[, 2]
compute.nmae(Y,X)

# If true values is a constant vector, NMAE = Inf.
# A warning is displayed and MAE is estimated instead of NMAE,
# unless true and imputed values are equal. In this case,
# by definition, NMAE = 0.
X <- rep(0, 10)
Y <- runif(10)
compute.nmae(Y,X) # MAE computed
Y <- X
compute.nmae(Y,X) # By definition, NMAE = 0

Example output

[1] 0.1673972
[1] 0.5685687
Warning message:
In compute.nmae(Y, X) :
  Vector of true values is constant !!! MAE was computed instead of NMAE !!!
[1] 0
Warning message:
In compute.nmae(Y, X) :
  Vectors of true and imputed values are constant and equal !!! By definition NMAE=0

DTWBI documentation built on May 2, 2019, 1:59 a.m.