mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Matrix must be positive definite

Open ElDuderinoBerlin opened this issue 2 years ago • 2 comments

Is there a way for checking that a matrix is not "positive definite"?

Regards Martin

ElDuderinoBerlin avatar Mar 18 '23 00:03 ElDuderinoBerlin

I am not sure this is an easy question to answer in a general way. It depends on whether the matrix is symmetric or not, or if you are interested to check if the matrix can be negative definite.

If you are just interested to check that the matrix is semi-positive definite, this would mean that there exists a vector x, such that x^T * A * x = 0. So if you find a non-trivial null space for the matrix, then you have your answer.

jkalias avatar Mar 18 '23 16:03 jkalias

From https://mathworld.wolfram.com/PositiveDefiniteMatrix.html:

The following are necessary (but not sufficient) conditions for a Hermitian matrix A (which by definition has real diagonal elements $a_{ii}$) to be positive definite.

  1. $a_{ii}>0$ for all $i$,
  2. $a_{ii}+a_{jj} > 2|\Re(a_{ij})|$ for $i \neq j$,
  3. The element with largest modulus lies on the main diagonal,
  4. $\det(A)>0$.

So if any of those conditions fail, you know the matrix is not p.d.

wo80 avatar Mar 27 '23 09:03 wo80