mahalanobis: Mahalanobis distance

mahalanobisR Documentation

Mahalanobis distance

Description

Generic for computing the squared Mahalanobis distance.

Usage

mahalanobis(x, center, cov, inverted = FALSE, ...)

## S4 method for signature 'ANY,ANY,SWoodburyMatrix'
mahalanobis(x, center, cov, inverted = FALSE, ...)

Arguments

x

Numeric vector or matrix

center

Numeric vector representing the mean; if omitted, defaults to zero mean

cov

Covariance matrix

inverted

Whether to treat cov as a precision matrix; must be FALSE for SWoodburyMatrix objects.

...

Passed to the Cholesky function.

Methods (by class)

  • x = ANY,center = ANY,cov = SWoodburyMatrix: Use the Woodbury matrix identity to compute the squared Mahalanobis distance with the implicit matrix as the covariance.

See Also

mahalanobis


WoodburyMatrix documentation built on July 9, 2023, 7:04 p.m.