SVD directive

Calculates singular value decompositions of matrices i.e. ( LEFT *+ SINGULAR *+ TRANSPOSE(RIGHT) ).


Option

PRINT = strings
Printed output required (left, singular, right); default * i.e. no printing


Parameters

INMATRIX = matrices
Matrices to be decomposed

LEFT = matrices
Left-hand matrix of each decomposition

SINGULAR = diagonal matrices
Singular values (middle) matrix

RIGHT = matrices
Right-hand matrix of each decomposition


Description

Suppose that we have a rectangular matrix A with m rows and n columns, and that p is the minimum of m and n. The singular value decomposition can be defined as

m An = mUp p Sp pVn

The diagonal matrix S contains the p singular values of A, ordered such that

s1s2 ≥ ... ≥ sp ≥ 0

The matrices U and V contain the left and right singular vectors of A, and are orthonormal:

UU = VV = Ip

The smaller of U and V will be orthogonal. So, if A has more rows than columns, m>n, p=n and VV′=Ip.

   The least-squares approximation of rank r to A can be formed as

Ar = Ur Sr Vr

where Ur and Vr are the first r columns of U and V, and Sr contains the first r singular values of A (Eckart & Young 1936).

   The INMATRIX parameter specifies the matrices to be decomposed. The algorithm uses Householder transformations to reduce A to bi-diagonal form, followed by a QR algorithm to find the singular values of the bi-diagonal matrix (Golub & Reinsch 1971). The other parameters allow you to save the component parts of the decomposition: LEFT, SINGULAR and RIGHT for U, S and V respectively.

   The PRINT option allows you to print any of the components of the decomposition; by default, nothing is printed. If any of the matrices is to be printed, all p columns are shown, even if you are storing only the first r columns.

   GenStat will decide how many columns and singular values r to store, and will store that number for any of the components that you specify. If none of the matrices in the LEFT, SINGULAR and RIGHT lists has been declared in advance, the full number of singular values (r=p) is stored; otherwise GenStat sets r to the maximum number of columns contained in any of the matrices. If r<p, the first r singular values will be saved, along with the corresponding columns of singular vectors.

   One practical application of the singular value decomposition is to form generalized inverses of matrices. If you use the singular value decomposition you obtain the Moore-Penrose generalized inverse, sometimes called the pseudo-inverse, and this is the method used by the GINVERSE procedure.

 

Option: PRINT.

Parameters: INMATRIX, LEFT, SINGULAR, RIGHT.


References

Eckart, C. & Young, G. (1936). The approximation of one matrix by another of lower rank. Psychometrika, 1, 211-218.

Golub, G.H. & Reinsch, C. (1971). Singular value decomposition and least squares solutions. Numerische Mathematik, 14, 403-420.