wrap {cellWise} | R Documentation |
Wrap the data.
Description
Transforms multivariate data X
using the wrapping function with b = 1.5
and c = 4
. By default, it starts by calling checkDataSet
to clean the data and estLocScale
to estimate the location and scale of the variables in the cleaned data, yielding the vectors and
where
is the number of variables. Alternatively, the user can specify such vectors in the arguments
locX
and scaleX
. In either case, the data cell containing variable
of case
is transformed to
in which and
are such that for any fixed
the average of
equals
and the standard deviation of
equals
.
Usage
wrap(X, locX = NULL, scaleX = NULL, precScale = 1e-12,
imputeNA = TRUE, checkPars = list())
Arguments
X |
the input data. It must be an |
locX |
The location estimates of the columns of the input data |
scaleX |
The scale estimates of the columns of the input data |
precScale |
The precision scale used throughout the algorithm. Defaults to |
imputeNA |
Whether or not to impute the |
checkPars |
Optional list of parameters used in the call to
|
Value
A list with components:
Xw
The wrapped data.colInWrap
The column numbers of the variables which were wrapped. Variables which were filtered out bycheckDataSet
(because of a (near) zero scale for example), will not appear in this output.loc
The location estimates for all variables used for wrapping.scale
The scale estimates for all variables used for wrapping.
Author(s)
Raymaekers, J. and Rousseeuw P.J.
References
Raymaekers, J., Rousseeuw P.J. (2019). Fast robust correlation for high dimensional data. Technometrics, 63(2), 184-198. (link to open access pdf)
See Also
Examples
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
# For more examples, we refer to the vignette:
## Not run:
vignette("wrap_examples")
## End(Not run)