sprojdepth | R Documentation |
Computes the skewness-adjusted projection depth of p
-dimensional
points z
relative to a p
-dimensional dataset x
.
sprojdepth(x, z = NULL, options = NULL)
x |
An |
z |
An optional |
options |
A list of options to pass to the underlying |
Skewness-adjusted projection depth is based on the adjusted
outlyingness and is computed as 1/(1+AO)
. As adjusted
outlyingness extends the Stahel-Donoho outlyingness towards
skewed distributions, the skewness-adjusted 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 adjOutl
for more details on the computation of the AO.
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
adjOutl
function. More details can be found there.
A list with components:
depthX |
Vector of length |
depthZ |
Vector of length |
cutoff |
Points whose skew-adjusted 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 |
P. Segaert with original code from M. Maechler, G. Brys, K. Vakili
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.
adjOutl
, sprojmedian
, mrainbowplot
, dirOutl
, outlyingness
# Compute the skewness-adjusted projection depth
# of a two-dimensional dataset.
data(bloodfat)
Result <- sprojdepth(x = bloodfat)
# A multivariate rainbowplot may be obtained using mrainbowplot.
plot.options = list(legend.title = "SPD")
mrainbowplot(x = bloodfat,
depths = Result$depthX, plot.options = plot.options)
# Options for the underlying outlyingness routine may be passed
# using the options argument.
Result <- sprojdepth(x = bloodfat,
options = list(type = "Affine",
ndir = 1000,
seed = 12345
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.