Mahalanobis distance measures the distance between a point and a distribution. It takes into account the correlations of the data set and is scale-invariant.

Defined as:

where:

  • is a vector of the point whose distance from the distribution is being measured
  • is the mean vector of the distribution
  • is the covariance matrix of the distribution
  • is the inverse of the covariance matrix