Learn R Programming

MNM (version 1.0-4)

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, ...)

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

Arguments

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.

Author

Klaus Nordhausen

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