Computes the generalized singular value decomposition of a pair of matrices.
gsvd(A,B)
a matrix with \(m\) rows and \(n\) columns.
a matrix with \(p\) rows and \(n\) columns.
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.
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] Q^T$$ and $$B = V D_2 [0\, R] Q^T$$ where
an \(m\times m\) orthogonal matrix.
a \(p\times p\) orthogonal matrix.
an \(n\times n\) orthogonal matrix.
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 \(\left( \begin{array}{c} A \\B \end{array} \right)\) with \(r \le n\).
are quasi diagonal matrices and nonnegative and satisfy \(D_1^T D_1 + D_2^T D_2 = I\). \(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] Q^H$$ and $$B = V D_2 [0\, R] Q^H$$ where
an \(m\times m\) unitary matrix.
a \(p\times p\) unitary matrix.
an \(n\times n\) unitary matrix.
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 \(\left( \begin{array}{c} A \\B \end{array} \right)\) with \(r \le n\).
are quasi diagonal matrices and nonnegative and satisfy \(D_1^T D_1 + D_2^T D_2 = I\). \(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.
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).
# NOT RUN {
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
# }
Run the code above in your browser using DataLab