gsvd: Generalized Singular Value Decomposition

Description Usage Arguments Details Value Source References See Also Examples

Description

Computes the generalized singular value decomposition of a pair of matrices.

Usage

1
gsvd(A,B)

Arguments

A

a matrix with m rows and n columns.

B

a matrix with p rows and n columns.

Details

The matrix A is a m-by-n matrix and the matrix B is a p-by-n matrix. This function decomposes both matrices; if either one is complex than the other matrix is coerced to be complex.

The Generalized Singular Value Decomposition of numeric matrices A and B is given as

A = U * D_1 * [0 R] * t(Q)

and

B = V * D_2 * [0 R] * t(Q)

where

U

an m-by-m orthogonal matrix.

V

a p-by-p orthogonal matrix.

Q

an n-by-n orthogonal matrix.

R

an r-by-r upper triangular non singular matrix and the matrix [0\, R] is an r-by-n matrix. The quantity r is the rank of the matrix rbind(A,B) with r <= n.

D_1,D_2

are quasi diagonal matrices and nonnegative and satisfy t(D_1)%*% D_1 + t(D_2) %*% D_2. D_1 is an m-by-r matrix and D_2 is a p-by-r matrix.

The Generalized Singular Value Decomposition of complex matrices A and B is given as

A = U * D_1 * [0 R] * t(Q)

and

B = V * D_2 * [0 R] * t(Q)

where

U

an m-by-m unitary matrix.

V

a p-by-p unitary matrix.

Q

an n-by-n unitary matrix.

R

an r-by-r upper triangular non singular matrix and the matrix [0\, R] is an r-by-n matrix. The quantity r is the rank of the matrix rbind(A,B) with r <= n.

D_1,D_2

are quasi diagonal matrices and nonnegative and satisfy t(D_1)%*% D_1 + t(D_2) %*% D_2. D_1 is an m-by-r matrix and D_2 is a p-by-r matrix.

For details on this decomposition and the structure of the matrices D_1 and D_2 see http://www.netlib.org/lapack/lug/node36.html.

Value

The return value is a list containing the following components

A

the upper triangular matrix or a part of R.

B

lower part of the triangular matrix R if k+l>m (see below).

m

number of rows of A.

k

r-l. The number of rows of the matrix R is k+l. The first k generalized singular values are infinite.

l

effective rank of the input matrix B. The number of finite generalized singular values after the first k infinite ones.

alpha

a numeric vector with length n containing the numerators of the generalized singular values in the first (k{+}l) entries.

beta

a numeric vector with length n containing the denominators of the generalized singular value in the first (k{+}l) entries.

U

the matrix U.

V

the matrix V.

Q

the matrix Q.

For a detailed description of these items see http://www.netlib.org/lapack/lug/node36.html. Auxiliary functions are provided for extraction and manipulation of the various items.

Source

gsvd uses the LAPACK routines DGGSVD3 and ZGGSVD3 from Lapack 3.8.0. LAPACK is from http://www.netlib.org/lapack. The decomposition is fully explained in http://www.netlib.org/lapack/lug/node36.html.

References

Anderson. E. and ten others (1999) LAPACK Users' Guide. Third Edition. SIAM.
Available on-line at http://www.netlib.org/lapack/lug/lapack_lug.html. See the section Generalized Eigenvalue and Singular Value Problems (http://www.netlib.org/lapack/lug/node33.html) and the section Generalized Singular Value Decomposition (GSVD) (http://www.netlib.org/lapack/lug/node36.html).

See Also

gsvd.aux

Examples

1
2
3
4
5
6
7
A <- matrix(c(1,2,3,3,2,1,4,5,6,7,8,8), nrow=2, byrow=TRUE)
B <- matrix(1:18,byrow=TRUE, ncol=6)
A
B

z <- gsvd(A,B)
z

Example output

     [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    1    2    3    3    2    1
[2,]    4    5    6    7    8    8
     [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    1    2    3    4    5    6
[2,]    7    8    9   10   11   12
[3,]   13   14   15   16   17   18
$A
     [,1] [,2]     [,3]       [,4]      [,5]      [,6]
[1,]    0    0 1.205375 -1.5493693  8.746719  9.309297
[2,]    0    0 0.000000 -0.7891233 -8.263864 -6.787066

$B
     [,1] [,2] [,3] [,4]     [,5]      [,6]
[1,]    0    0    0    0 31.01906 33.514874
[2,]    0    0    0    0  0.00000  4.855042
[3,]    0    0    0    0  0.00000  0.000000

$m
[1] 2

$k
[1] 2

$l
[1] 2

$alpha
[1] 1 1 0 0 0 0

$beta
[1] 0 0 1 1 0 0

$U
           [,1]       [,2]
[1,] -0.8353324 -0.5497453
[2,] -0.5497453  0.8353324

$V
           [,1]       [,2]       [,3]
[1,] -0.2672612  0.8728716  0.4082483
[2,] -0.5345225  0.2182179 -0.8164966
[3,] -0.8017837 -0.4364358  0.4082483

$Q
              [,1]          [,2]        [,3]       [,4]        [,5]
[1,]  3.283390e-01  3.204993e-01  0.14358353 -0.4950232  0.26318068
[2,] -4.184012e-01 -7.208865e-01  0.08651096  0.0504075  0.06579517
[3,] -3.864914e-01  5.601627e-01  0.02943840  0.5958382 -0.13159034
[4,]  7.148304e-01 -2.396634e-01 -0.23009449  0.4446157 -0.32897585
[5,] -2.382768e-01  7.988780e-02 -0.69208772 -0.4032600 -0.52636136
[6,]  3.774758e-15  1.790235e-15  0.66264932 -0.1925782 -0.72374686
              [,6]
[1,] -6.741999e-01
[2,] -5.393599e-01
[3,] -4.045199e-01
[4,] -2.696799e-01
[5,] -1.348400e-01
[6,] -5.551115e-17

attr(,"class")
[1] "xdgsvd"

geigen documentation built on May 30, 2019, 5:03 p.m.