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

203 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 9 de Sept. de 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 comentarios
Walter Roberson
Walter Roberson el 24 de Dic. de 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 el 14 de Mzo. de 2014
Editada: Mohammad Haghighat el 14 de Mzo. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by