mahalanobis_depth: Mahalanobis Depth

View source: R/mahalanobis_depth.R

mahalanobis_depthR Documentation

Mahalanobis Depth

Description

Computes the Mahalanobis depth of one or more query points with respect to a reference distribution estimated from data.

Usage

mahalanobis_depth(x, data, mu = NULL, sigma = NULL)

Arguments

x

Numeric matrix of query points (m x d), or a numeric vector of length d for a single query point.

data

Numeric matrix of reference data (n x d). Used to estimate the mean and covariance.

mu

Optional numeric vector of length d. If supplied, overrides the mean estimated from data.

sigma

Optional numeric matrix (d x d). If supplied, overrides the covariance estimated from data. Must be positive definite.

Value

Numeric vector of depth values in (0, 1], one per query point.


depthR documentation built on June 26, 2026, 5:07 p.m.