dprojdepth | R Documentation |
Computes the directional projection depth of p
-dimensional
points z
relative to a p
-dimensional dataset x
.
dprojdepth(x, z = NULL, options = NULL)
x |
An |
z |
An optional |
options |
A list of options to pass to the underlying See |
Directional projection depth is based on the directional
outlyingness and is computed as 1/(1+DO)
. As directional
outlyingness extends the Stahel-Donoho outlyingness towards
skewed distributions, the directional projection depth
is suited for both elliptical distributions and skewed
multivariate data.
It is first checked whether the data is found to lie in a subspace of
dimension lower than p
. If so, a warning is given, as well as the
dimension of the subspace and a direction which is orthogonal to it.
See dirOutl
for more details on the computation of the DO.
To visualize the depth of bivariate data one can apply the
mrainbowplot
function. It plots the data colored according to
their depth.
The output values of this function are based on the output of the
dirOutl
function. More details can be found there.
A list with components:
depthX |
Vector of length |
depthZ |
Vector of length |
cutoff |
Points whose directional projection depth is smaller than this cutoff can be considered as outliers. |
flagX |
Observations of |
flagZ |
Points of |
singularSubsets |
When the input parameter type is equal to |
dimension |
When the data |
hyperplane |
When the data |
inSubspace |
When a direction |
J. Raymaekers
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.
dirOutl
, dprojmedian
, mrainbowplot
, adjOutl
, outlyingness
# Compute the directional projection depth
# of a simple two-dimensional dataset.
# Outliers are plotted in red.
data(bloodfat)
Result <- dprojdepth(x = bloodfat)
IndOutliers <- which(!Result$flagX)
plot(bloodfat)
points(bloodfat[IndOutliers,], col = "red")
# A multivariate rainbowplot may be obtained using mrainbowplot.
plot.options = list(legend.title = "DPD")
mrainbowplot(x = bloodfat,
depths = Result$depthX, plot.options = plot.options)
# Options for the underlying outlyingness routine may be passed
# using the options argument.
Result <- dprojdepth(x = bloodfat,
options = list(type = "Affine", ndir=100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.