Kardi Teknomo
Kardi Teknomo Kardi Teknomo Kardi Teknomo
   
 
Research
Publications
Tutorials
Resume
Personal
Resources
Contact

 

Mahalanobis Distance

Similarity

<Content | Previous | Next >

It is also called quadratic distance. It measures the separation of two groups of objects. Suppose we have two groups with means and , Mahalanobis distance is given by the following

Formula mahalanobis distance

The data of the two groups must have the same number of variables (the same number of columns) but not necessarily to have the same data (each group may have different number of rows).

 

For example: Suppose we have two groups of data, each of group consists of two variables (x, y). The scattered plot of data is shown below.

data and mean scattered plot of data

First, we center the data on the arithmetic mean of each variable.

centered data for Mahalanobis distance

Covariance matrix of group Index of group for Mahalanobis distance is computed using centered data matrix centered data matrix

Covariance matrix for Mahalanobis distance

It produces covariance matrices for group 1 and 2 as follow

Covariance group 2 Covariance group 1

The pooled covariance matrix of the two groups is computed as weighted average of the covariance matrices. The weighted average takes this form

Mahalanobis distance.

The pooled covariance is computed using weighted average (10/15)*Covariance group 1 + (5/15)*Covariance group 2 yields

Pooled covariance matrix

The Mahalanobis distance is simply quadratic multiplication of mean difference and inverse of pooled covariance matrix.

Inverse pooled covariance for Mahalanobis distance Men differences for Mahalanobis distance

The final result of Mahalanobis distance is

Mahalanobis distance

 

<Content | Previous | Next >

 

 

Comments for this tutorial

 

This tutorial is copyrighted.

Preferable reference for this tutorial is

Teknomo, Kardi. Similarity Measurement. http:\\people.revoledu.com\kardi\ tutorial\Similarity\

 

 

 

 
© 2006 Kardi Teknomo. All Rights Reserved.
Designed by CNV Media