mrfDepth (version 1.0.1)

sprojdepth: Skewness-adjusted projection depth of points relative to a dataset

Description

Computes the skewness-adjusted projection depth of $p$-dimensional points z relative to a $p$-dimensional dataset x.

Usage

sprojdepth(x, z = NULL, options = NULL)

Arguments

x
An $n$ by $p$ data matrix with observations in the rows and variables in the columns.
z
An optional $m$ by $p$ matrix containing rowwise the points $z_i$ for which to compute the projection depth. If z is not specified, it is set equal to x.
options
A list of options to pass to the underlying adjOutlyingness routine. See adjOutlyingness for the full list of options.

Value

A list with components:

Details

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 adjOutlyingness 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 adjOutlyingness function. More details can be found there.

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, sprojmedian, mrainbowplot, outlyingness, projdepth, projmedian

Examples

Run this code
# Compute the skewness-adjusted projection depth 
# of a simple two-dimensional dataset.
# Outliers are plotted in red.

data(bloodfat)
Result <- sprojdepth(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 = "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
                                    )
                    )

Run the code above in your browser using DataLab