Serving the Quantitative Finance Community

 
User avatar
bskilton81
Topic Author
Posts: 0
Joined: December 16th, 2004, 8:30 pm

Non-Pos Definite Covariance Matrix in Matlab

August 2nd, 2006, 3:43 pm

I am trying to optimize using a non-positive-definite covariance matrix. So I computed the eigenvalues and vectors in matlab using eigen(C). Then I removed the zero and negative eigenvalues and their corresponding vectors. Then recomputed Cadj (the adjusted C) using V*D*V' where V and D are the adjusted eigenvectors and eigenvalues respectively. I test positive definiteness using p from [R,p] = chol(Cadj), and it is still not positive definite. Am I doing something wrong?
 
User avatar
janickg
Posts: 0
Joined: August 3rd, 2004, 1:13 pm

Non-Pos Definite Covariance Matrix in Matlab

August 2nd, 2006, 4:12 pm

How did you remove those zero and negative eigen values? If you forcefully set them equal to zero your resultant recomposition later will still not be psd numerically. Try setting them to a small positive number, like 1e^-8
 
User avatar
bskilton81
Topic Author
Posts: 0
Joined: December 16th, 2004, 8:30 pm

Non-Pos Definite Covariance Matrix in Matlab

August 2nd, 2006, 4:50 pm

Thanks. That did it. Am I correct in assuming this would screw up the symmetry of the matrix, in which case I should just make C = (C + C')/2?
Last edited by bskilton81 on August 1st, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
player
Posts: 0
Joined: August 5th, 2002, 10:00 am

Non-Pos Definite Covariance Matrix in Matlab

August 6th, 2008, 9:24 am

Can someone clarity an issue for me. I have a matrix which i am trying to make into psd. All eigenvalues are >0 bar 2 which are negative but extremely close to zero. If I change this eigenvalues to something like 1^e-8 then do i just mutiply the matrix of the adjusted eigenvalues with the previous matrix of eigenvectors to get the new psd covaraince matrix?
 
User avatar
janickg
Posts: 0
Joined: August 3rd, 2004, 1:13 pm

Non-Pos Definite Covariance Matrix in Matlab

August 6th, 2008, 4:28 pm

That is correct.