numpy (matrix solver) - python vs. matlab

Paul Rubin no.email at nospam.invalid
Wed May 2 03:56:31 EDT 2012


someone <newsboost at gmail.com> writes:
>> You will probably get better advice if you are able to describe what
>> problem (ill-posed or otherwise) you are actually trying to solve.  SVD
> I don't understand what else I should write. I gave the singular
> matrix and that's it. Nothing more is to say about this problem,

You could write what your application is.  What do the numbers in that
matrix actually represent?  

> except it would be nice to learn some things for future use (for
> instance understanding SVD more 

The Wikipedia article about SVD is pretty good.  

> Still, I dont think I completely understand SVD. SVD (at least in
> Matlab) returns 3 matrices, one is a diagonal matrix I think. 

Yes.  Two diagonal matrices and a unitary matrix.  The diagonal matrices
have the singular values which are the magnitudes of the matrix's
eigenvalues.  A matrix (for simplicity consider it to have nonzero
determinant) represents a linear transformation in space.  Think of a
bunch of vectors as arrows sticking out of the origin in different
directions, and consider what happens to them if you use the matrix to
act on all of them at once.  You could break the transformation into 3
steps: 1) scale the axes by suitable amounts, so all the vectors stretch
or shrink depending on their directions.  2) Rotate all the vectors
without changing their lengths, through some combination of angles; 3)
undo the scaling transformation so that the vectors get their original
lengths back.  Each of these 3 steps can be described by a matrix and
the 3 matrices are what SVD calculates.

I still don't have any idea whether this info is going to do you any
good.  There are some quite knowledgeable numerics folks here (I'm not
one) who can probably be of more help, but frankly your questions don't
make a whole lot of sense.  

You might get the book "Numerical Recipes" which is old but instructive.
Maybe someone else here has other recommendations.



More information about the Python-list mailing list