MATLAB Function Reference
  Go to function:
    Search    Help Desk 
gsvd    Examples   See Also

Generalized singular value decomposition

Syntax

Description

[U,V,X,C,S] = gsvd(A,B) returns unitary matrices U and V, a (usually) square matrix X, and nonnegative diagonal matrices C and S so that

A and B must have the same number of columns, but may have different numbers of rows. If A is m-by-p and B is n-by-p, then U is m-by-m, V is n-by-n and X is p-by-q where q = min(m+n,p).

sigma = gsvd(A,B) returns the vector of generalized singular values, sqrt(diag(C'*C)./diag(S'*S)).

The nonzero elements of S are always on its main diagonal. If m >= p the nonzero elements of C are also on its main diagonal. But if m < p, the nonzero diagonal of C is diag(C,p-m). This allows the diagonal elements to be ordered so that the generalized singular values are nondecreasing.

gsvd(A,B,0), with three input arguments and either m or n >= p, produces the "economy-sized" decomposition where the resulting U and V have at most p columns, and C and S have at most p rows. The generalized singular values are diag(C)./diag(S).

When B is square and nonsingular, the generalized singular values, gsvd(A,B), are equal to the ordinary singular values, svd(A/B), but they are sorted in the opposite order. Their reciprocals are gsvd(B,A).

In this formulation of the gsvd, no assumptions are made about the individual ranks of A or B. The matrix X has full rank if and only if the matrix [A;B] has full rank. In fact, svd(X) and cond(X) are are equal to svd([A;B]) and cond([A;B]). Other formulations, eg. G. Golub and C. Van Loan [1], require that null(A) and null(B) do not overlap and replace X by inv(X) or inv(X').

Note, however, that when null(A) and null(B) do overlap, the nonzero elements of C and S are not uniquely determined.

Examples

In the first example, the matrices have at least as many rows as columns.

The statement

produces a 5-by-5 orthogonal U, a 3-by-3 orthogonal V, a 3-by-3 nonsingular X,

and

Since A is rank deficient, the first diagonal element of C is zero.

The economy sized decomposition,

produces a 5-by-3 matrix U and a 3-by-3 matrix C.

The other three matrices, V, X, and S are the same as those obtained with the full decomposition.

The generalized singular values are the ratios of the diagonal elements of C and S.

These values are a reordering of the ordinary singular values

In the second example, the matrices have at least as many columns as rows.

The statement

produces a 3-by-3 orthogonal U, a 5-by-5 orthogonal V, a 5-by-5 nonsingular X and

In this situation, the nonzero diagonal of C is diag(C,2). The generalized singular values include three zeros.

Reversing the roles of A and B reciprocates these values, producing three infinities.

Algorithm

The generalized singular value decomposition uses the C-S decomposition described in [1], as well as the built-in svd and qr functions. The C-S decomposition is implemented in a subfunction in the gsvd M-file.

Diagnostics

The only warning or error message produced by gsvd itself occurs when the two input arguments do not have the same number of columns.

Reference

[1] Golub, Gene H. and Charles Van Loan, Matrix Computations, Third Edition, Johns Hopkins University Press, Baltimore, 1996

See Also

svd Singular value decomposition



[ Previous | Help Desk | Next ]