Learn R Programming

DepthProc (version 2.1.5)

depthMah: Mahalanobis Depth

Description

Computes the mahalanobis depth of a point or vectors of points with respect to a multivariate data set.

Usage

depthMah(u, X, cov = NULL, mean = NULL, threads = -1)

Arguments

u

Numerical vector or matrix whose depth is to be calculated. Dimension has to be the same as that of the observations.

X

The data as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one multivariate observation. If it is a list, all components must be numerical vectors of equal length (coordinates of observations).

cov

custom covariance matrix passed. If NULL standard calculations will be based on standard covariance estimator.

mean

custom mean vector. If null --- mean average will be used.

threads

number of threads used in parallel computations. Default value -1 means that all possible cores will be used.

Details

Calculation of Mahalanobis depth is exact.

Returns the depth of multivariate point u with respect to data set X.

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(9999), nc = 3)
depthMah(x, x)

# }

Run the code above in your browser using DataLab