How do I determine if a matrix is positive definite using MATLAB?

42 Ansichten (letzte 30 Tage)
A symmetric matrix is defined to be positive definite if the real parts of all eigenvalues are positive.
A non-symmetric matrix (B) is positive definite if all eigenvalues of (B+B')/2 are positive.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 9 Sep. 2013
This change has been incorporated into the documentation in Release 14 Service Pack 3 (R14SP3). For previous releases, read below for any additional information:
Rather than using the EIG function to obtain the eigenvalues in order to determine positive definiteness, it is more computationally efficient to use the CHOL function. The CHOL function provides an optional second output argument "p" which is zero if the matrix is found to be positive definite. If the input matrix is not positive definite, then "p" will be a positive integer:
>>[~,p] = chol(zeros(3))
p =
1
The CHOL function will return an error if it is only provided with a single output argument, and is also given a matrix that is not positive definite. NOTE: CHOL expects its input matrix to be symmetric and only looks at the upper triangular portion of the matrix.
  3 Kommentare
Walter Roberson
Walter Roberson am 24 Dez. 2013
I think Sepehr is implying that the "p" output of chol() is returning 0, implying that chol thinks it is positive definite. (I have not tried it myself.)
Mohammad Haghighat
Mohammad Haghighat am 14 Mär. 2014
Bearbeitet: Mohammad Haghighat am 14 Mär. 2014
Unfortunately, I couldn't see the code since the open-source code for chol.m was not available for me.
However, they might have considered " greater than or equal" as in the definition of " positive semi-definite ". That might be the reason why it gives a 0 to p.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Produkte


Version

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by