[SciPy-Dev] Strange results by eigs

Tony Stillfjord tony at maths.lth.se
Fri Oct 21 02:19:02 EDT 2011


I'm not really an authority on these matters, but I agree with Josef.

In the dense case you would have to do a Cholesky decomposition, and
we have to assume that it does not break down until the last step. As far
as I know, the cost for this is O(n^3). On the other hand, computing a few
eigenvalues should be O(n^2) if you do not want them all (in which case
you would be using eig anyway).

In addition to what Pauli wrote about the sparse case, even if there was
a sparse (incomplete) Cholesky decomposition implemented you could
not really use it. To be sure that the matrix really was positive definite
you
would essentially have to set all tolerances to zero and compute the full
factorization. This would (possibly) result in huge amounts of fill-in. Not
good.

So yes, please leave it as it is.

Kind regards,
Tony Stillfjord

On Thu, Oct 20, 2011 at 10:39 PM, <josef.pktd at gmail.com> wrote:

> On Thu, Oct 20, 2011 at 4:16 PM, Pauli Virtanen <pav at iki.fi> wrote:
> > (20.10.2011 19:57), Nils Wagner wrote:
> > [clip]
> >> It means that there is no check for B inside eigs.
> >> IMHO, a warning should be raised if B is not hermitian
> >> positive (semi-)definite.
> >
> > That could be useful.
> >
> > Checking PD is may be more expensive since it requires trying to do a
> > Cholesky decomposition. Would need some benchmarks to check whether it
> > matters.
> >
> > It's also possible to do the check only for dense matrices. Scipy
> > doesn't have a sparse Cholesky at the moment, and moreover, the linear
> > operator can be an arbitrary function with no way to obtain the
> transpose.
>
> none of the scipy numpy eigh functions do a check.
>
> Since I use them mostly for gram, covariance matrices, where I already
> know it's symmetric, I wouldn't like any expensive checks, in linalg,
> I don't use sparse so far.
>
> user responsibility to check the doc string ?
>
> Josef
>
> >
> > --
> > Pauli Virtanen
> >
> > _______________________________________________
> > SciPy-Dev mailing list
> > SciPy-Dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-dev
> >
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20111021/6c8db753/attachment.html>


More information about the SciPy-Dev mailing list