mrfDepth (version 1.0.12)

dprojmedian: Location estimates based on directional projection depth.

Description

Computes a directional projection depth based location estimate of a \(p\)-dimensional dataset x.

Usage

dprojmedian(x, dprojection.depths = NULL, options = NULL)

Arguments

x

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

dprojection.depths

Vector containing the directional projection depths of the points in x.

options

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

Value

A list with components:

max

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

gravity

The center of gravity for the 50 percent points with highest directional projection depth. Also called the center of gravity of the bag.

Details

The algorithm depends on the function dprojdepth to calculate the directional projection depths of the dataset x. If the directional 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, directional projection depths will be calculated and the user can pass a list with options to the dprojdepth 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

Rousseeuw, P.J., Raymaekers, J., Hubert, M., (2018), A Measure of Directional Outlyingness with Applications to Image Data and Video. Journal of Computational and Graphical Statistics, 27, 345--359.\

See Also

dirOutl, dprojdepth, adjOutl, outlyingness

Examples

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

result <- dprojmedian(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 <- dprojmedian(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 <- dprojdepth(x = bloodfat)
result <- dprojmedian(x = bloodfat,dprojection.depths = depth.result$depthX)
# }

Run the code above in your browser using DataLab