mahalanobis distance with non symmetric and positive covariance

I have an array of 36 vectors with 46 dimensions. I'm trying to find the distance between my 36 vectors by using mahalanobis distance. I can't apply it in matlab because the covariance result is not symmetric and positive definite.
Could you help me with that please ?

回答 (2 件)

John D'Errico
John D'Errico 2015 年 2 月 22 日

0 投票

You can always use my nearestSPD tool, as posted on the file exchange.
A covariance matrix based on fewer samples than variables must always be singular. I'm not sure what this says about the distances you would compute, but nearestSPD will make a matrix usable for any tool that requires a Cholesky decomposition.
feras almasri
feras almasri 2015 年 2 月 23 日

0 投票

Thanks a lot that helped. But I think the result is not appropriate to use the mahalanobis distance cause the matrix result was wrong.

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2015 年 2 月 22 日

回答済み:

2015 年 2 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by