Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Eigenvalues of Positive Definite matrices - &MATLAB

  1. Sep 15, 2006 #1
    I'm trying to create an algorithm in MATLAB, but I have a problem. According to theory, if G is a positive definite matrix, then it's eigenvalues are positive real numbers. I'm using function EIG() to calculate the eigenvalues and eigenvectors of matrices, but I almost always take and negative numbers as eigenvalues.

    a =
    1 2 3
    2 1 2 → Eigenvalues taken: -2.0000, -0.7016, 5.7016
    3 2 1
    a =
    0 1 2
    1 0 1 → Eigenvalues taken: -2.0000, -0.7321, 2.7321
    2 1 0

    My Questions:
    1) How can I test is a matrix is positive definite matrix, without having to test the equation z*Az>0 for every z? (- that's impossible to test in that way, for every possible z!!).

    2) Are the above example matrices Positive Definite? And if not why?

    3) Can anyone provide me with 3x3, 4x4 or 5x5 at least Positive Definite matrices? ..

    4) If the example matrices I gave, are positive definite, then why EIG() is giving me negative eigenvalues? I use it as [V,D]=eig(a) (-the eigenvalues are at the diagonal of D).

    5) And, are the eigenvalues I show here, correct for these two example matrices?....!...

    That's my questions. If anyone can help.. Thanks :)

    Ps. I'm not mathematician, so please, if you can, don't mess me with with "high-complexibilty" mathematics/theories.
  2. jcsd
  3. Sep 15, 2006 #2

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    1. It is porefectly possible to prove that a matrix is positive definite, and you don't just check every possible z. You could try finding the eigenvalues..... If you really want to you could just work out what (x,y,z)A(x,y,z)^t is as a function of x,y,z and see if it is ever negative using some optimization routines, or working it out bby hand if that it is impractical.

    2. No, they are not. They have negative eigenvalues.

    3. The identity matrix. Any diagonal matrix with postive entries on the diagonal.


    5. Work them out by hand for yourself if you don't trust the computer. It is just writing out a cubic equation and finding the roots.
  4. Sep 18, 2006 #3
    New arising problems

    Hi.. Thanks for answering and help me...
    However I have some more questions... In order to write mathematical types, I wrote that question in PDF, and I use it as attachment to this forum-thread.

    Please read the PDF, and if you know what I might do wrong, answer me...

    Attached Files:

  5. Sep 18, 2006 #4
    Taking a simple example, where G=[3x3] matrix, I noticed that I get negative eigenvalues using the expressions of the PDF I have attached above, if I give the σ > ~2.1. Thus I have no problem if I use σ < 2 values. But the question remains.. Why for σ > 2, I get negative eigenvalues, in contrast with what the author report?..
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook