[R] A problem with chol() function
Ron Michael
ron_michael70 at yahoo.com
Sun Oct 23 08:33:41 CEST 2011
I think I am missing something with the chol() function. Here is my calculation:
> mat
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 0 0 0
[2,] 0 1 0 0 0
[3,] 0 0 1 0 0
[4,] 0 0 0 1 0
[5,] 0 0 0 0 1
> eigen(mat)
$values
[1] 1 1 1 1 1
$vectors
[,1] [,2] [,3] [,4] [,5]
[1,] 1 -1.000000e+00 0 0 0
[2,] 0 7.401487e-17 0 0 0
[3,] 0 0.000000e+00 1 0 0
[4,] 0 0.000000e+00 0 1 0
[5,] 0 0.000000e+00 0 0 1
> chol(mat)
Error in chol.default(mat) :
the leading minor of order 2 is not positive definite
As per the eigen values my matrix is PD (as all eigen values are positive). Then why still I can not get Cholesky factor of my matrix? Can somebody point mw where I am missing?
Thanks and regards,
More information about the R-help
mailing list