Is there any solution to make positive semi-definite covariance matrix?
1 次查看(过去 30 天)
显示 更早的评论
I have image data. row of the data represents pixel and column represents rgb values. that is, the size of the data is N by 3. However, I would like to apply kmeans and GMM for clustering. But the covariance matrix is not positive semi-definite.
Why and what is solution?
0 个评论
采纳的回答
Walter Roberson
2016-7-5
Covariance matrices of real variables are always positive semi-definite. See http://math.stackexchange.com/questions/114072/what-is-the-proof-that-covariance-matrices-are-always-semi-definite
If you calculated a covariance matrix but it is being reported as not positive semi-definite then you might have encountered numeric round-off. In such a case use
(X.' + X) / 2
in place of X: this will eliminate any round-off error that is keeping the matrix from being completely symmetric.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!