MATLAB Eigenvalues of Positive Definite matrices - &MATLAB

AI Thread Summary
The discussion revolves around the calculation of eigenvalues for positive definite matrices in MATLAB, specifically using the EIG() function. The user is encountering negative eigenvalues for matrices they believe should be positive definite, prompting questions about verifying positive definiteness without exhaustive testing and the nature of their example matrices. Responses clarify that the provided matrices are not positive definite due to their negative eigenvalues, and suggest that the identity matrix or any diagonal matrix with positive entries can serve as examples of positive definite matrices. Additionally, the user raises concerns about discrepancies in eigenvalue calculations when varying parameters in their examples, particularly for values greater than approximately 2. The conversation emphasizes the importance of correctly identifying positive definite matrices to avoid erroneous eigenvalue results.
Sevenbar
Messages
3
Reaction score
0
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.

F.e.
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.
 
Physics news on Phys.org
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.

4.

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.
 
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...
 

Attachments

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?..
 

Similar threads

Back
Top