We know that covariance matrix is a positive semi definite matrix and should have positive determinant. However, when dimensions are large, matlab command 'cov' is returning covariance with zero determinant. Can anybody please suggest a way to do away with this error?

回答 (5 件)

Honglei Chen
Honglei Chen 2012 年 1 月 24 日

0 投票

Maybe your data matrix has correlated components so the resulting covariance matrix is not full rank?
suran samanta
suran samanta 2012 年 1 月 24 日

0 投票

Basically I have number_of_samples < dimension_of_data Most probably this is the reason for getting a non PSD covariance matrix. I tried calculating the determinant using QR decomposition. If C is the covariance matrix, then, [Q R]=qr(C); then, C=R'Q'QR and det(C)=det®^2. But this is only dealing with negative determinant. However the definition of PSD matrix says that it should have determinant > 0. So is there any more tricks by which i can solve this problem?
Honglei Chen
Honglei Chen 2012 年 1 月 24 日

0 投票

What you have is rank-deficient so the determinant will be 0. If you just want the algorithm to work, you can try to do the diagonal loading on your covariance matrix. However, I would suggest you to address the data issue as you are not getting a good estimates of covariance matrix anyway if your number of samples is less than the dimension of data. The rule of thumb is that the number of samples should be at least twice the number of data dimensions if I remember it correctly.
suran samanta
suran samanta 2012 年 1 月 25 日

0 投票

thanks for the replies. got some idea.

カテゴリ

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

質問済み:

2012 年 1 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by