determinant of covariance matrix

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?

Answers (5)

Honglei Chen
Honglei Chen on 24 Jan 2012
Maybe your data matrix has correlated components so the resulting covariance matrix is not full rank?
suran samanta
suran samanta on 24 Jan 2012
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 on 24 Jan 2012
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 on 25 Jan 2012
thanks for the replies. got some idea.

Categories

Asked:

on 24 Jan 2012

Community Treasure Hunt

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

Start Hunting!