Learn R Programming

MNM (version 0.95-0)

spatial.sign2: Spatial Signs

Description

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.

Usage

spatial.sign2(X, center = TRUE, shape = TRUE, eps.S = 1e-05, 
              na.action = na.fail, ...)

Arguments

Value

  • 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'.

Details

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^{-\frac{1}{2}}$ and then computing $$u_{i}=\frac{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}=\frac{z_i}{\| z_i \|} I(\| z_i \| > eps.S) + \frac{z_i}{eps.S} I(\| z_i \| \leq eps.S).$$

See Also

spatial.sign, HR.Mest

Examples

Run this code
# 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))

Run the code above in your browser using DataLab