cellWise (version 2.1.1)

wrap: Wrap the data.

Description

Transforms multivariate data X using the wrapping function with b = 1.5 and c = 4 and the location and scale given in locX and scaleX.

Usage

wrap(X, locX, scaleX, precScale = 1e-12)

Arguments

X

the input data. It must be an \(n\) by \(d\) matrix or a data frame.

locX

The location estimates of the columns of the input data X. Must be a vector of length \(d\).

scaleX

The scale estimates of the columns of the input data X. Must be a vector of length \(d\).

precScale

The precision scale used throughout the algorithm. Defaults to \(1e-12\)

Value

A list with components:

  • Xw The wrapped data.

  • colInWrap The column numbers for which the scale estimate was larger than precScale. Those with scale estimate <= precScale do not occur in Xw to avoid division by (near) zero.

References

Raymaekers, J., Rousseeuw P.J. (2019). Fast robust correlation for high dimensional data. Technometrics, published online.

See Also

estLocScale

Examples

Run this code
# NOT RUN {
library(MASS) 
set.seed(12345) 
n <- 100; d <- 10
X <- mvrnorm(n, rep(0, 10), diag(10))
locScale <- estLocScale(X)
Xw <- wrap(X, locScale$loc, locScale$scale)$Xw
# }

Run the code above in your browser using DataCamp Workspace