| compute_depth | R Documentation |
Computes the statistical depth of every row of data with respect to
the empirical distribution of data, returning a depth object
from which medians, outliers, ranks, and other derived quantities can be
extracted cheaply without recomputing depth.
compute_depth(data, depth_fn = mahalanobis_depth, ...)
data |
Numeric matrix (n x d) or data frame. Rows are observations, columns are variables. |
depth_fn |
Depth function to use. Must have signature
|
... |
Additional arguments forwarded to |
An object of class "depth" with components:
Numeric vector of length n — depth of each observation.
The original data matrix.
The depth function used.
Number of observations.
Dimension.
The matched call.
set.seed(42)
data <- matrix(rnorm(500), nrow = 100, ncol = 5)
dd <- compute_depth(data, depth_fn = mahalanobis_depth)
median(dd)
rank(dd)
outliers(dd)
summary(dd)
plot(dd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.