mrfDepth (version 1.0.1)

sprojmedian: 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 depths of the points in x.
options
A list of options to pass to the sprojdepth routine. See sprojdepth for more details.

Value

A list with components:

Details

The algorithm depends on the function sprojdepth to calculate the skewness-adjusted projection depths of the dataset x. If the skewness-adjusted projection depths of the points $x_i$ have already been calculated they can be passed as an optional argument to save computation time. If not, skewness-adjusted projection depths will be calculated 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.

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

adjOutlyingness, sprojdepth, outlyingness, projdepth, projmedian

Examples

Run this code
# Compute a location estimate of a simple two-dimensional dataset.
data(bloodfat)

result <- sprojmedian(x = bloodfat)
plot(bloodfat)
points(result$max, col = "red", pch = 15)
points(result$gravity, col = "blue", pch = 16)


# Options for the underlying sprojdepth routine may be passed 
# using the options argument. 
result <- sprojmedian(x = bloodfat,
                      options = list(type = "Affine",
                                     ndir = 10
                                     )
                     )
plot(bloodfat)
points(result$max, col = "red", pch = 15)
points(result$gravity, col = "blue", pch = 16)

# One may also calculate the depths of the points in the data
# separately. This avoids having to recompute the depths when these
# are previously calculated. 
depth.result <- sprojdepth(x = bloodfat)
result <- sprojmedian(x = bloodfat, 
                      sprojection.depths = depth.result$depthX)

Run the code above in your browser using DataLab