Re: SVD require 'k' singular values/vectors only

From: Steven Lord (slord_at_mathworks.com)
Date: 01/24/05


Date: Mon, 24 Jan 2005 15:05:09 -0500


"spasmous" <spasmous@yahoo.com> wrote in message
news:1106594010.321914.149730@f14g2000cwb.googlegroups.com...
> I know this is a FAQ topic but I haven't seen an answer...
>
> If I have a dense m x n matrix (m=rows > n=cols) and require only the k
> < n largest singular values and vectors, is there an SVD algorithm that
> extracts only what is needed? Or does the algorithm have to get all
> singular values, then sort them and return only the requested ones?
>
> I know MATLAB has a 'svds' function that does this but it's very slow
> compared to normal 'svd'. One would expect if k<<n then the code would
> be faster!

SVDS converts that matrix of size [m n] into a sparse matrix of size [(m+n),
(m+n)] and uses EIGS to compute the eigenvalues of that matrix. If your
original matrix is full, this will probably be a Big Sparse matrix. You
might want to try using the economy SVD using "SVD(A, 0)" [see HELP SVD for
a full description of what that syntax does] and pull the required K
singular values out of that -- that may be quicker.

-- 
Steve Lord
slord@mathworks.com


Relevant Pages

  • Linear algebra challenge answers
    ... Singular Value Decomposition (SVD), a function found on the HP48G and HP49G ... From an m x n matrix initially on the stack, ... The determinant of a square matrix is the product of its singular ...
    (comp.sys.hp48)
  • Linear algebra challenge answers
    ... Singular Value Decomposition (SVD), a function found on the HP48G and HP49G ... From an m x n matrix initially on the stack, ... The determinant of a square matrix is the product of its singular ...
    (comp.sys.hp48)
  • Re: SVD when calculated for a corpus of similar category?
    ... Peter Spellucci wrote: ... Suppose i compute SVD for a huge corpus ... >singular values in the diagonal matrix S arranged in descending order ...
    (sci.math.num-analysis)
  • Re: SVD when calculated for a corpus of similar category?
    ... Suppose i compute SVD for a huge corpus ... >singular values in the diagonal matrix S arranged in descending order ...
    (sci.math.num-analysis)
  • Re: Writing a matrix as a multiplication of two vectors
    ... this matrix will be highly singular with a rank of only 1. ... If A, an m X n matrix has rank r, it can be represented by a weighted ... The weights and vectors are called the singular ... functions SVD and SVDS. ...
    (comp.soft-sys.matlab)