Mahalanobis distance dimension question
Afficher commentaires plus anciens
The documentation for this function says that X must have more rows than columns. Can someone explain to me why this is mathematically so?
Réponses (1)
Roger Stafford
le 14 Avr 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
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!