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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With