[SciPy-User] Eigenvalue decomposition bug

Sebastian Walter sebastian.walter at gmail.com
Wed May 12 14:48:43 EDT 2010


Hello Pauli,
On what kind of matrix did you observe such unstable behavior?
Were there repeated eigenvalues?

Sebastian





On Tue, May 11, 2010 at 10:39 PM, Pauli Virtanen <pav at iki.fi> wrote:
> Tue, 11 May 2010 16:04:00 -0400, Ian Goodfellow wrote:
>> I've find that (scipy/numpy).linalg.eig have a problem where given a
>> symmetric matrix they return complex eigenvalues. I can use scipy.io to
>> save this matrix in matlab format, load it in matlab, and use matlab's
>> eig function to succesfully decompose it with real eigenvalues, so the
>> problem seems to be with scipy/numpy or their dependencies, not with my
>> matrix. Is this a known issue? And is there a good workaround?
>
> Use the eigh function if you know your matrix is symmetric.
>
> Matlab IIRC checks first if the matrix is symmetric, and if yes, uses a
> symmetric-specific eigensolver. Numpy and Scipy don't do this automatic
> check.
>
> A nonsymmetric eigensolver cannot know that your matrix is supposed to
> have real eigenvalues, so it's possible some of them explode to complex
> pairs because of minuscule numerical error. The imaginary part, however,
> is typically small.
>
> --
> Pauli Virtanen
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list