Mahalanobis distance dimension question
5 views (last 30 days)
Show older comments
The documentation for this function says that X must have more rows than columns. Can someone explain to me why this is mathematically so?
0 Comments
Answers (1)
Roger Stafford
on 14 Apr 2016
The reason is that matlab must compute the covariance of the matrix X and then find the inverse of this covariance matrix in order to compute the mahalanobis distance of Y from X. Unfortunately, if there are not more more rows than columns in X - that is to say, more observations than variables - its covariance matrix will be singular, that is, its determinant will be zero. That will make it impossible to find its inverse.
For an explanation of the mahalanobis distance see the site:
https://en.wikipedia.org/wiki/Mahalanobis_distance
0 Comments
See Also
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!