Re: problem with svd in numpy
- From: Robert Kern <robert.kern@xxxxxxxxx>
- Date: Thu, 02 Nov 2006 11:36:12 -0800
Zeynep Gerek wrote:
Hello,
I am having weird problem with svd routine in python.
numpy questions are best asked on the numpy list.
http://www.scipy.org/Mailing_Lists
I am comparing eigenvector values from python and matlab. And they are giving different values. Actually, they are same but python gives negative values of these numbers.
This is my test program (I am dealing with 100x100 matrices) with the array I used in matlab.
I am not sure if svd in numpy has a problem or not. When I test this matrix in matlab, eigenvector values are different, Any idea why I am not getting exact results from both program?
You didn't show what code you executed in Matlab. Did you also do an SVD there, or did you do an eigenvalue decomposition? The two are not the same thing. Which did you intend to do?
In any case, it looks as if numpy_u == -matlab_u. How do numpy_vt and matlab_vt compare? Do they also have flipped signs? If so, then there is no problem. (u, vt) can be replaced with (-u, -vt). The SVD is not unique. Which one you get depends on the precise operations of the implementation.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
.
- Prev by Date: Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?
- Next by Date: Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?
- Previous by thread: Creating db front end or middleware.
- Next by thread: what's the difference between these two methods? (aka, why doesn't one of them work?)
- Index(es):
Relevant Pages
|