sprojmedian: Location estimates based on skewness-adjusted projection...

View source: R/sprojmedian.R

sprojmedianR Documentation

Location estimates based on skewness-adjusted projection depth

Description

Computes a skewness-adjusted projection depth based location estimate of a p-dimensional dataset x.

Usage

sprojmedian(x, sprojection.depths = NULL, options = NULL)

Arguments

x

An n by p data matrix with observations in the rows and variables in the columns.

sprojection.depths

Vector containing the skewness-adjusted projection depth values of the observations in x.

options

A list of options to pass to the sprojdepth routine. See sprojdepth for more details.

Details

The algorithm depends on the function sprojdepth to compute the skewness-adjusted projection depth values of the observations in x. If these depth have already been computed they can be passed as an optional argument to save computing time. If not, the skewness-adjusted projection depth values will be computed and the user can pass a list with options to the sprojdepth function.

It is first checked whether the data lie in a subspace of dimension smaller than p. If so, a warning is given, as well as the dimension of the subspace and a direction which is orthogonal to it.

Value

A list with component:

max

The point of x with maximal skewness-adjusted projection depth. If multiple points have maximum depth, their center of gravity is returned.

Author(s)

P. Segaert

References

Hubert M., Van der Veeken S. (2008). Outlier detection for skewed data. Journal of Chemometrics, 22, 235–246.

Hubert M., Rousseeuw P.J., Segaert P. (2015). Multivariate functional outlier detection. Statistical Methods & Applications, 24, 177–202.

See Also

adjOutl, sprojdepth, dirOutl, outlyingness

Examples

# Compute a location estimate of a two-dimensional dataset.
data(bloodfat)

result <- sprojmedian(x = bloodfat)
plot(bloodfat, pch = 16)
points(result$max, col = "red", pch = 18, cex = 1.5)

# Options for the underlying sprojdepth routine may be passed 
# using the options argument. 
result <- sprojmedian(x = bloodfat,
                      options = list(type = "Rotation",
                                     ndir = 1000
                                     )
                     )
plot(bloodfat, pch = 16)
points(result$max, col = "red", pch = 18, cex = 1.5)

# One may also compute the depth values of the observations in the data
# separately. This avoids having to recompute them when computing the median. 
depth.result <- sprojdepth(x = bloodfat)
result <- sprojmedian(x = bloodfat, 
                      sprojection.depths = depth.result$depthX)

mrfDepth documentation built on Oct. 6, 2023, 5:07 p.m.