Learn R Programming

kernDeepStackNet (version 2.0.2)

robustStandard: Robust standardization

Description

Scales the data matrix with the median and median absolute deviation.

Usage

robustStandard(X)

Arguments

X

Data design matrix.

Value

Numeric transformed data matrix with same dimension as original data.

References

Ricardo A. Maronna and R. Douglas Martin and Victor J. Yohai, (2006), Robust Statistics: Theory and Methods, John Wiley \& Sons, Ltd.

Examples

Run this code
# Generate data matrix
set.seed(150)
X <- matrix(rnorm(100*3), ncol=3)

# Robust standardization
scaledX <- robustStandard(X=X)

# Median equals 0
all.equal(sapply(1:3, function(x) median(scaledX[,x])), rep(0, 3))

# MAD equals 1
all.equal(sapply(1:3, function(x) mad(scaledX[,x], constant=1)), rep(1, 3))

Run the code above in your browser using DataLab