# Mahalanobis Distance

Mahalanobis distance is a distance calculated using the inverse of the covariance matrix as the metric. For two vectors $\mathbf x$ and $\mathbf y$, the Mahalanobis distance is

$$ d^2 = (x_i - \bar x) g_{ij} (y_j - \bar y), $$

where $g_{ij} = (S^{-1})_{ij}$ and $\mathbf S$ is the covariance matrix.

The covariance is a normalization that mitigates the covariances.

Planted:
by L Ma;

References:

No backlinks identified. Reference this note using the Note ID

`cards/math/mahalanobis-distance.md`

in other notes to connect them.