svd_truncated_test, a MATLAB code which calls the economy version of the Singular Value Decomposition (SVD) of an M by N rectangular matrix, in cases where M < N or N < M.
The singular value decomposition of an M by N rectangular matrix A has the form
A(mxn) = U(mxm) * S(mxn) * V'(nxn)where
It is often the case that the matrix A has one dimension much bigger than the other. For instance, M = 3 and N = 10,000 might be such a case. For such examples, much of the computation and memory required for the standard SVD may not actually be needed. Instead, a truncated, or reduced version is appropriate. It will be computed faster, and require less memory to store the data.
If M < N, we have the "truncated V" SVD:
A(mxn) = U(mxm) * Sm(mxm) * Vm'(nxm)Notice that, for our example, we will have to compute and store a Vm of size 30,000 instead of a V of size 1,000,000 entries.
If N < M, we have the "truncated U" SVD:
A(mxn) = Un(mxn) * Sn(nxn) * V'(nxn)Similarly, in this case, the computation and storage of Un can be much reduced from that of U.
The MATLAB function
[ u, s, v ] = svd ( a )returns the standard SVD. However, by including the switch 'econ', you can request the truncated SVD:
[ u, s, v ] = svd ( a, 'econ' )This will automatically create the truncated V or truncated U decomposition, depending on whether M < N or N < M.
The information on this web page is distributed under the MIT license.
svd_truncated is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
fingerprints, a dataset directory which contains a few images of fingerprints.
svd_basis, a MATLAB code which computes a reduced basis for a collection of data vectors using the singular value decomposition (SVD).
svd_faces, a MATLAB code which applies singular value decomposition (SVD) analysis to a set of images.
svd_fingerprint, a MATLAB code which reads a file containing a fingerprint image and uses the singular value decomposition (SVD) to compute and display a series of low rank approximations to the image.
svd_gray, a MATLAB code which reads a gray scale image, computes the singular value decomposition (SVD), and constructs a series of low rank approximations to the image.
svd_lls, a MATLAB code which uses the singular value decomposition (SVD) to construct and plot the best affine and linear relationships in the sense of least square, between two vectors of data.
svd_powers, a MATLAB code which applies singular value decomposition (SVD) analysis to powers x(i)^(j-1).
svd_snowfall, a MATLAB code which reads a file containing historical snowfall data and analyzes the data with the singular value decomposition (SVD).
svd_sphere, a MATLAB code which analyzes a linear map of the unit sphere caused by an arbitrary 3x3 matrix A, using the singular value decomposition (SVD).
svd_test, a MATLAB code which demonstrates the singular value decomposition (SVD) for a simple example.