x
. Computation is exact for $p \le 2$ and approximate for $p > 2$.
hdepthmedian(x, maxdir = NULL)
x
. This point is not always unique. In that case the halfspace median corresponds to the center of gravity of the convex set of deepest points.It is first checked whether the data is found to lie in a subspace of dimension lower than $p$. If so, the routine will give a warning, giving back the dimension of the subspace together with a direction describing a hyperplane containing this subspace.
For bivariate data the exact algorithm of Rousseeuw and Ruts (1998) is applied.
When the data are not in general position (i.e. when there is a line containing more than two observations) dithering is performed by adding random Gaussian noise to the data. In this the ouput argument dithered
will containg a flag.
When $p > 2$ the approximate algorithm of Struyf and Rousseeuw (2000) is applied. It is an iterative procedure based on projections. Their number can be chosen by the input parameter maxdir
.
Struyf A., Rousseeuw P.J. (2000). High-dimensional computation of the deepest location. Computational Statistics & Data Analysis, 34, 415--436.
# Compute a location estimate of a simple
# two-dimensional dataset.
data(cardata90)
Result <- hdepthmedian(x=cardata90)
Run the code above in your browser using DataLab