Working with Mahalanobis distance in TI Nspire CX

The Mahalanobis distance is an important method in statistical analysis. It is a different thinking from the common Euclidean distance and considered the dimensionality of standard deviation. In TI Nspire, there is no built-in function for Mahalanobis distance. However, it can be easily calculated using the matrix operations available.

mahalanobis1

Using independent variables x1, x2, and dependent variable y. Firstly, the covariance matrix is obtained by either the first inverse matrix equation above, or the next one where d is defined as row-wise as x1, x2, and a last row of 1’s.

mahalanobis2

Once the covariance matrix is determined, the Mahalanobis distance for x1, x2 can be determined by the above equation, which is a summation of distances times the number of observation minus one. The use of a sum function on matrix is just for convenience of input and display as the summation function can be very long.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s