Bidiagonal SVD decomposition

Singular value decomposition of a rectangular matrix A of size MxN is its representation in the form of product A = U W VT, where U is an orthogonal matrix of size MxM, W - diagonal matrix of size MxN with non-negative elements on the main diagonal (singular values) in descending order, V - orthogonal matrix of size NxN.

Note #1
The singular value decomposition has a number of useful properties which enable it to be used for matrix inversion and pseudoinversion, solving systems of linear equations and evaluating condition numbers, solving underdetermined and overdetermined systems and a number of other problems.

There are several algorithms for computing singular values of a bidiagonal matrix. Taking into account that there is an algorithm reduces rectangular matrix to bidiagonal in finite number of steps using two-sided orthogonal transformation, we can reduce the problem of singular value decomposition of a general matrix to a singular value decomposition of a bidiagonal matrix. This is done in algorithm of SVD decomposition of rectangular matrix.

Subroutine description

The subroutine RMatrixBDSVD performs the singular value decomposition of a bidiagonal matrix given by arrays D and E (main and secondary diagonals). Depending on the value of IsUpper the matrix is considered as an upper or lower bidiagonal matrix.

The algorithm saves the obtained singular values in array D (replacing the main diagonal). Transformation matrices U and VT are returned as follows. The algorithm gets a variable U and VT. The variable U contains a matrix with NRU rows N columns and is right-sided multiplied by the transformation matrix U. The variable VT contains a matrix with N rows NCVT columns and is left-sided multiplied by the transformation matrix VT.

Thus, if we know the singular vectors of a bidiagonal matrix, we can obtain the singular vectors of a general matrix (if the matrices which transform it into bidiagonal form are known). If singular vectors are not required, NRU and NCVT should be zeros.

The parameter IsFractionalAccuracyRequired controls the precision of finding singular values. If it is set to True, the singular values will be found to have the same relative error, otherwise they will be found to have the same absolute error. Usually, it is recommended to use a False value (this can speed an algorithm up), since in most applications there is no need in extended precision of small singular values.

This article is licensed for personal use only.

Download ALGLIB for C++ / C# / Java / Python / ...

ALGLIB Project offers you two editions of ALGLIB:

ALGLIB Free Edition:
+delivered for free
+offers full set of numerical functionality
+extensive algorithmic optimizations
-no multithreading
-non-commercial license

ALGLIB Commercial Edition:
+flexible pricing
+offers full set of numerical functionality
+extensive algorithmic optimizations
+high performance (SMP, SIMD)
+commercial license with support plan

Links to download sections for Free and Commercial editions can be found below:

ALGLIB 4.01.0 for C++

C++ library.
Delivered with sources.
Monolithic design.
Extreme portability.
Editions:   FREE   COMMERCIAL

ALGLIB 4.01.0 for C#

C# library with native kernels.
Delivered with sources.
VB.NET and IronPython wrappers.
Extreme portability.
Editions:   FREE   COMMERCIAL

ALGLIB 4.01.0 for Java

Java wrapper around HPC core.
Delivered with sources.
Seamless integration with Java.
Editions:   FREE   COMMERCIAL

ALGLIB 4.01.0 for Delphi

Delphi wrapper around C core.
Delivered as precompiled binary.
Compatible with FreePascal.
Editions:   FREE   COMMERCIAL

ALGLIB 4.01.0 for CPython

CPython wrapper around C core.
Delivered as precompiled binary.
Editions:   FREE   COMMERCIAL