spatial.sign2 {MNM} | R Documentation |
The function computes the spatial signs for a data set. This function differs from the function spatial.sign
in the way
how observations with small norms are treated. For details see below.
spatial.sign2(X, center = TRUE, shape = TRUE, eps.S = 1e-05, na.action = na.fail, ...)
X |
a numeric data frame or matrix. |
center |
either a logical value or a numeric vector of length equal to the number of columns of 'X'. See below for more information. |
shape |
either a logical value or a square numeric matrix with number of columns equal to the number of columns of 'X'. See below for more information. |
eps.S |
treshold value which defines which obersvations are considered to have a small norm. |
na.action |
a function which indicates what should happen when the data contain 'NA's. Default is to fail. |
... |
arguments that can be passed on to functions used for the estimation of location and shape. |
The spatial signs U of X with location mu and shape V are given by transforming the data points z_i=(x_i-mu)V^{-0.5} and then computing
u_i = z_i\||z_i||.
If a numeric value is given as 'center' and/or 'shape' these are used as mu and/or V in the above formula. If 'center' and/or 'shape' are 'TRUE' the values for mu and/or V are estimated, if 'FALSE' the origin is used as the value of mu and/or the identity matrix as the value of V.
When the norm ||z_i|| is 0 then the spatial sign is set usually to 0 as for example in the function
spatial.sign
. Here however if the spatial designs are defined as
u_i=z_i\||z_i|| I(||z_i||>eps.S)+ z_i\eps.S I(||z_i||<=eps.S).
a matrix with the spatial signs of the data as rows or the univariate signs as a px1 matrix. The centering vector and scaling matrix used are returned as attributes 'center' and 'shape'.
Klaus Nordhausen, klaus.nordhausen@uta.fi
# comparing spatial.sign and spatial.sign2 data(pulmonary) head(spatial.sign2(pulmonary, c(-0.1099999,-0.12,-4.3),FALSE)) head(spatial.sign(pulmonary, c(-0.1099999,-0.12,-4.3),FALSE))