Hello I am trying to determine wether a given matrix is symmetric and
positive matrix. The matrix has real valued elements.

I have been reading about the cholesky method and another method is to find
the eigenvalues. I cant understand how to implement either of the two. Can
someone point me to the right direction. I have used ?chol to see the help
but if the matrix is not positive definite it comes up as error. I know how
to the get the eigenvalues but how can I then put this into a program to
check them as the just come up with $values.

Is checking that the eigenvalues are positive enough to determine wether the
matrix is positive definite?

 m
     [,1] [,2] [,3] [,4] [,5]
[1,]  1.0  0.0  0.5 -0.3  0.2
[2,]  0.0  1.0  0.1  0.0  0.0
[3,]  0.5  0.1  1.0  0.3  0.7
[4,] -0.3  0.0  0.3  1.0  0.4
[5,]  0.2  0.0  0.7  0.4  1.0

this is the matrix that I know is positive definite.

eigen(m)
$values
[1] 2.0654025 1.3391291 1.0027378 0.3956079 0.1971228

$vectors
            [,1]        [,2]         [,3]        [,4]        [,5]
[1,] -0.32843233  0.69840166  0.080549876  0.44379474  0.44824689
[2,] -0.06080335  0.03564769 -0.993062427 -0.01474690  0.09296096
[3,] -0.64780034  0.12089168 -0.027187620  0.08912912 -0.74636235
[4,] -0.31765040 -0.68827876  0.007856812  0.60775962  0.23651023
[5,] -0.60653780 -0.15040584  0.080856897 -0.65231358  0.42123526

and this are the eigenvalues and eigenvectors.
I thought of using
 eigen(m,only.values=T)
$values
[1] 2.0654025 1.3391291 1.0027378 0.3956079 0.1971228

$vectors
NULL

Then i thought of using logical expression to determine if there are
negative eigenvalues but couldnt work. I dont know what error this is

 b<-(a<0)
Error: (list) object cannot be coerced to type 'double'

Thanks

	[[alternative HTML version deleted]]

