Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia: Can isposdef() be used to determine if a matrix can be factored by Cholesky decomposition?

Tags:

math

matrix

julia

I am trying to use isposdef() in Julia as a way to test a priori whether a matrix can be factored by the cholesky decomposition.

It looks like isposdef does not always work. Am I using it incorrectly?

Example:

D = [5, 8]
V = [1 2; 3 4]
A = V*diagm(D)*inv(V)
println(eig(A))
println(isposdef(A))

Here I create a matrix A with positive eigenvalues given in D. We see that eig(A) agrees they are positive. Isposdef(), however, returns false. Am I missing something?

Thank you

like image 538
Mageek Avatar asked Jun 19 '14 17:06

Mageek


1 Answers

If a matrix A has cholesky decomposition, then A can be written as A=LL^T( which is feasible if A=QDQ^T and eigen values are all positive, where L=QD^0.5) which implies that the matrix should be positive-definite(this subsumes the symmetricity also).

From your example, for the matrix A = VDinv(V), the matrix of eigen vectors V, you chose is not Orthonormal. So you cant go from A = VDinv(V) to the form above for cholesky decomposition.

As to your main question, since positive definiteness is necessary and sufficient condition for cholesky decomposition to exist, isposdef() can be used to check if a cholesky decomposition exists.

PS: Please look at Mark Dickinson's comments under the question for a more general discussion.

like image 191
spv Avatar answered Nov 03 '22 12:11

spv