This is documentation for an old release of SciPy (version 0.10.0). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.spatial.distance.mahalanobis

scipy.spatial.distance.mahalanobis(u, v, VI)

Computes the Mahalanobis distance between two n-vectors u and v, which is defiend as

(u-v)V^{-1}(u-v)^T

where VI is the inverse covariance matrix V^{-1}.

Parameters :

u : ndarray

An n-dimensional vector.

v : ndarray

An n-dimensional vector.

Returns :

d : double

The Mahalanobis distance between vectors u and v.

Previous topic

scipy.spatial.distance.kulsinski

Next topic

scipy.spatial.distance.matching

This Page