mahal: Mahalanobis Distance

Description Usage Arguments Details Examples

View source: R/distribution.R

Description

Returns the Mahalanobis distance of a data point to a multivariate normal distribution object of class mvnd.

Usage

1
mahal(object, x)

Arguments

object

an object of class mvnd.

x

a data point, provided as vector with same length as dimensions of the mvnd object.

Details

Calls the base mahalanobis function mahalanobis(x, object$means, object$covar)

Examples

1
2
3
d <- mvnd(c(0,1),matrix(c(2,3,3,2),ncol=2), c('a', 'b'))
mahal(d, c(1,1))
mahal(d, c(0,2))

manschmi/blm documentation built on May 21, 2019, 11:25 a.m.