0

enter image description here

enter image description here

why first matrix in fig is not positive definte, but second is a positive definite matrix. As Eigen values of both the matrix are non negative. and also real(A)-transpose(real(A)) is zero in both the cases. and also in both the diagonal elements are real. plz clarify it.

[ 2.3130 -0.3336 + 0.3101i 0.2220 - 0.3105i -1.0822 + 0.4137i -0.2176 + 0.3402i; -0.3336 - 0.3101i 1.7028 - 0.0000i -0.0159 + 1.8658i 0.8151 + 1.0404i -0.7560 - 0.6449i; 0.2220 + 0.3105i -0.0159 - 1.8658i 2.6546 - 0.0000i 1.2165 - 1.4006i -0.7925 + 0.8759i; -1.0822 - 0.4137i 0.8151 - 1.0404i 1.2165 + 1.4006i 2.4392 - 0.0000i -0.4110 + 0.1399i; -0.2176 - 0.3402i -0.7560 + 0.6449i -0.7925 - 0.8759i -0.4110 - 0.1399i 0.7696 + 0.0000i ] Sir I have edited. Plz now clarify my problem.

  • If you were to write the matrix in a format I could cut and paste into matlab, then I could look at the matrix and see what was going on. Do you think you could post the code that produced the matrix? Also, don't post it as an image, because I cannot cut and paste from that. – Stephen Montgomery-Smith Feb 12 '14 at 17:16
  • [ 2.3130 -0.3336 + 0.3101i 0.2220 - 0.3105i -1.0822 + 0.4137i -0.2176 + 0.3402i; -0.3336 - 0.3101i 1.7028 - 0.0000i -0.0159 + 1.8658i 0.8151 + 1.0404i -0.7560 - 0.6449i; 0.2220 + 0.3105i -0.0159 - 1.8658i 2.6546 - 0.0000i 1.2165 - 1.4006i -0.7925 + 0.8759i; -1.0822 - 0.4137i 0.8151 - 1.0404i 1.2165 + 1.4006i 2.4392 - 0.0000i -0.4110 + 0.1399i; -0.2176 - 0.3402i -0.7560 + 0.6449i -0.7925 - 0.8759i -0.4110 - 0.1399i 0.7696 + 0.0000i ] – user3256924 Feb 20 '14 at 06:34
  • But that isn't the matrix that is causing you the problems, isn't it? – Stephen Montgomery-Smith Feb 20 '14 at 12:50
  • Sir,this matrix also causing the same problem.. – user3256924 Feb 23 '14 at 04:53
  • I put this matrix into octave (a free replacement of matlab), and it did the cholesky factorization just fine. The eigenvalues are quite far from zero. So my guess it is a bug in matlab. The eigenvalues range from 0.0099361 to 6.2787231. – Stephen Montgomery-Smith Feb 23 '14 at 05:05

1 Answers1

1

Just because a matrix is symmetric (or hermitian in the complex case) doesn't mean its positive definite. You need to check if its symmetric (or hermitian) and has positive eigenvalues (or equivalently, its rayleigh quotient is positive). One simple criterion on paper is Sylvester's criterion (principal minors test) or gershgorin's circle theorem- in the first case, the $3x3$ principal minor is already on the order of $10^{-6}$ with the 4 decimal places, so its conceivable that roundoff may be doing something [ I can't be bothered to type out all the minors into octave, and certainly not the precision that is internally being used ].

In regards to a comment: The code above takes the Cholesky decomposition of the real part of a Hermitian matrix A (which gives a symmetric matrix real(A)). For the general complex case, you should use A instead of real(A), and have the .' replaced with ' in issym (maybe call it ishermitian) and replace the words symmetric with hermitian.

I would try doing eig(real(A)) and seeing if all the eigenvalues are indeed positive (in general, Matlab recommends using chol to test for p.d.-ness) and making sure real(A) is indeed symmetric (you can check this with the anonymous function "issym=@(x) all(all(x==x.'));", which is 1 if input is symmetric, 0 otherwise).

Outputting the eigenvalues to the Matlab terminal may not be sufficient due to roundoff (though you should get at least a $-0$ hopefully, indicating it is not positive definite - test this with the "vector of eigenvalues>0" - this should be all 1's), or the Cholesky decomposition algorithm may not be stable enough provided it is indeed positive definite to work (i.e. you have a pretty bad matrix).

You may be hitting some round off error or something which is making it not positive definite.

Batman
  • 19,390
  • Why eig(real(A))? You can't just ignore the imaginary part of the matrix. What you need is this: eig(A+A'). If the eigenvalues of the Hermitian part of the matrix are positive, then it is positive definite. – Michael Grant Feb 11 '14 at 18:21
  • He's taking the cholesky decomposition of the real part of A where A is hermitian (giving a symmetric matrix), not A itself. – Batman Feb 11 '14 at 19:28
  • Ah, I see now! Of course, now I wonder if he really should be doing that, either :-) – Michael Grant Feb 11 '14 at 20:00
  • yes sir, eig(A+A') is all positive – user3256924 Feb 12 '14 at 06:14
  • If we are not taking the real(A, thn first part giving the same result as given and second matrix also gives that matrix is not positive definite) – user3256924 Feb 12 '14 at 06:16