Depth and outlyingness measures#
Depth and outlyingness functions are related concepts proposed to order the observations of a dataset, extend the concept of median and trimmed statistics to multivariate and functional data and to detect outliers.
Depth#
Depth measures are functions that assign, to each possible observation, a value measuring how deep is that observation inside a given distribution (usually the distribution is approximated by a dataset). This function has it maximum value towards a “center” of the distribution, called the median of the depth. This allows a extension of the concept of median to multivariate or functional data. These functions also provide a natural order of the data, which is required to apply methods such as the boxplot or the trimmed mean.
The interface of a depth function is given by the following class:
Abstract class representing a depth function. |
The following classes implement depth functions for functional data:
|
Functional depth as the integral of a multivariate depth. |
Implementation of Band Depth for functional data. |
|
Implementation of Modified Band Depth for functional data. |
|
Functional depth based on a metric. |
Most of them support functional data with more than one dimension on the domain and on the codomain.
Multivariate depths#
Some utilities, such as the
MagnitudeShapePlot
require computing
a non-functional (multivariate) depth pointwise.
Moreover, some functional depths, such as the
integrated depth
are defined
using multivariate depths.
Thus we also provide some multivariate depth functions:
Computes Projection depth. |
|
Simplicial depth. |
Outlyingness#
The concepts of depth and outlyingness are (inversely) related. A deeper datum is less likely an outlier. Conversely, a datum with very low depth is possibly an outlier. The following interface (which is very similar to the one used for depths) is used to define an outlyingness measure:
Abstract class representing an outlyingness function. |
Multivariate outlyingness#
We provide the classical Stahel-Donoho outlyingness measure for the univariate data case:
|
Computes Stahel-Donoho outlyingness. |
Conversion#
As depth and outlyingness are closely related, there are ways to convert one into the other. The following class define a depth based on an outlyingness measure.
Computes depth based on an outlyingness measure. |