On Wed, 13 Jul 2005, Makram Talih wrote:
Dear R-users,
Is there a preferred method for testing whether a real symmetric matrix is
positive definite? [modulo machine rounding errors.]
The obvious way of computing eigenvalues via E - eigen(A, symmetric=T,
only.values=T)$values and returning
To reinforce Prof. Ripley's comment that, Knowing the determinant
does not tell you if the matrix is close to non-positive definite, note
that the determinant of the negative of the identity matrix, (-diag(k)),
is (-1)^k; if k is even, the determinant is positive. This silly
My preference is to test see if the smallest eigenvalue is less than
something like sqrt(.Machine$double.eps) times the largest. This may be
too conservative, but if the ratio of the smallest to the largest is
less than some small number like that, the inverse of such a real