On Tue, Sep 2, 2014 at 2:30 PM, Andrea Fresu <[email protected]> wrote:
> Hello,
> I have this symmetric matrix:
>
> A=Matrix([[0, 0.623433638694170, 1, 5.42879559377412], [0.623433638694170,
> 0, 1, 6.81321272473753], [1, 1, 0, 0], [5.42879559377412, 6.81321272473753,
> 0, 0]])
>
> I did
>
> A.cholesky()
>
> getting:
>
> ⎡ 0 0 0 0 ⎤
> ⎢ ⎥
> ⎢zoo zoo 0 0 ⎥
> ⎢ ⎥
> ⎢zoo nan nan 0 ⎥
> ⎢ ⎥
> ⎣zoo nan nan nan⎦
>
> What can I do to get the correct result?
It looks like a bug. You can use numpy as follows:
In [17]: a = matrix2numpy(A, dtype=float)
In [18]: numpy.linalg.cholesky(a)
---------------------------------------------------------------------------
LinAlgError Traceback (most recent call last)
<ipython-input-18-0367e248ee93> in <module>()
----> 1 numpy.linalg.cholesky(a)
/local/certik/bld/profile/o3tqau5cbqzb/lib/python2.7/site-packages/numpy/linalg/linalg.pyc
in cholesky(a)
529 results = lapack_routine(_L, n, a, m, 0)
530 if results['info'] > 0:
--> 531 raise LinAlgError('Matrix is not positive definite - '
532 'Cholesky decomposition cannot be computed')
533 s = triu(a, k=0).transpose()
LinAlgError: Matrix is not positive definite - Cholesky decomposition
cannot be computed
So it looks like your matrix is not positive definite.
Ondrej
> Thanks for the time,
>
> Andrea Fresu
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/18051c80-1ea2-4b6e-a7ad-e9710a4f4d7c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CADDwiVArfYU6HN0B%3D_YjGZi1%2B0RsjBGkuCn%3DgNT8gzzHn38JBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.