# Generalized singular value decomposition

In linear algebra, the generalized singular value decomposition (GSVD) is the name of two different techniques based on the singular value decomposition (SVD). The two versions differ because one version decomposes two matrices (somewhat like the higher-order or tensor SVD) and the other version uses a set of constraints imposed on the left and right singular vectors of a single-matrix SVD.

## First version: two-matrix decomposition

The generalized singular value decomposition (GSVD) is a matrix decomposition on a pair of matrices which generalizes the singular value decomposition. It was introduced by Van Loan in 1976 and later developed by Paige and Saunders, which is the version described here. In contrast to the SVD, the GSVD decomposes simultaneously a pair of matrices with the same number of columns. The SVD and the GSVD, as well as some other possible generalizations of the SVD, are extensively used in the study of the conditioning and regularization of linear systems with respect to quadratic semi-norms. In the following, let $\mathbb {F} =\mathbb {R}$, or $\mathbb {F} =\mathbb {C}$.

### Definition

The generalized singular value decomposition of matrices $A_{1}\in \mathbb {F} ^{m_{1}\times n}$ and $A_{2}\in \mathbb {F} ^{m_{2}\times n}$ is${\begin{aligned}A_{1}&=U_{1}\Sigma _{1}[W^{*}D,0_{D}]Q^{*},\\A_{2}&=U_{2}\Sigma _{2}[W^{*}D,0_{D}]Q^{*},\end{aligned}}$where
* $U_{1}\in \mathbb {F} ^{m_{1}\times m_{1}}$ is unitary,
* $U_{2}\in \mathbb {F} ^{m_{2}\times m_{2}}$ is unitary,
* $Q\in \mathbb {F} ^{n\times n}$ is unitary,
* $W\in \mathbb {F} ^{k\times k}$is unitary,
* $D\in \mathbb {R} ^{k\times k}$ is real diagonal with positive diagonal, and contains the non-zero singular values of $C={\begin{bmatrix}A_{1}\\A_{2}\end{bmatrix}}$ in decreasing order,
* $0_{D}=0\in \mathbb {R} ^{k\times (n-k)}$,
* $\Sigma _{1}=\lceil I_{A},S_{1},0_{A}\rfloor \in \mathbb {R} ^{m_{1}\times k}$ is real non-negative block-diagonal, where $S_{1}=\lceil \alpha _{r+1},\dots ,\alpha _{r+s}\rfloor$ with $1>\alpha _{r+1}\geq \cdots \geq \alpha _{r+s}>0$, $I_{A}=I_{r}$, and $0_{A}=0\in \mathbb {R} ^{(m_{1}-r-s)\times (k-r-s)}$,
* $\Sigma _{2}=\lceil 0_{B},S_{2},I_{B}\rfloor \in \mathbb {R} ^{m_{2}\times k}$ is real non-negative block-diagonal, where $S_{2}=\lceil \beta _{r+1},\dots ,\beta _{r+s}\rfloor$ with $0<\beta _{r+1}\leq \cdots \leq \beta _{r+s}<1$, $I_{B}=I_{k-r-s}$, and $0_{B}=0\in \mathbb {R} ^{(m_{2}-k+r)\times r}$,
* $\Sigma _{1}^{*}\Sigma _{1}=\lceil \alpha _{1}^{2},\dots ,\alpha _{k}^{2}\rfloor$,
* $\Sigma _{2}^{*}\Sigma _{2}=\lceil \beta _{1}^{2},\dots ,\beta _{k}^{2}\rfloor$,
* $\Sigma _{1}^{*}\Sigma _{1}+\Sigma _{2}^{*}\Sigma _{2}=I_{k}$,
* $k={\textrm {rank}}(C)$.
We denote $\alpha _{1}=\cdots =\alpha _{r}=1$, $\alpha _{r+s+1}=\cdots =\alpha _{k}=0$, $\beta _{1}=\cdots =\beta _{r}=0$, and $\beta _{r+s+1}=\cdots =\beta _{k}=1$. While $\Sigma _{1}$ is diagonal, $\Sigma _{2}$ is not always diagonal, because of the leading rectangular zero matrix; instead $\Sigma _{2}$ is "bottom-right-diagonal".

### Variations

There are many variations of the GSVD. These variations are related to the fact that it is always possible to multiply $Q^{*}$ from the left by $EE^{*}=I$ where $E\in \mathbb {F} ^{n\times n}$ is an arbitrary unitary matrix. We denote
* $X=([W^{*}D,0_{D}]Q^{*})^{*}$
* $X^{*}=[0,R]{\hat {Q}}^{*}$, where $R\in \mathbb {F} ^{k\times k}$ is upper-triangular and invertible, and ${\hat {Q}}\in \mathbb {F} ^{n\times n}$ is unitary. Such matrices exist by RQ-decomposition.
* $Y=W^{*}D$. Then $Y$ is invertible.
Here are some variations of the GSVD:
* MATLAB (gsvd):${\begin{aligned}A_{1}&=U_{1}\Sigma _{1}X^{*},\\A_{2}&=U_{2}\Sigma _{2}X^{*}.\end{aligned}}$
* LAPACK (LA_GGSVD):${\begin{aligned}A_{1}&=U_{1}\Sigma _{1}[0,R]{\hat {Q}}^{*},\\A_{2}&=U_{2}\Sigma _{2}[0,R]{\hat {Q}}^{*}.\end{aligned}}$
* Simplified:${\begin{aligned}A_{1}&=U_{1}\Sigma _{1}[Y,0_{D}]Q^{*},\\A_{2}&=U_{2}\Sigma _{2}[Y,0_{D}]Q^{*}.\end{aligned}}$

### Generalized singular values

A generalized singular value of $A_{1}$ and $A_{2}$ is a pair $(a,b)\in \mathbb {R} ^{2}$ such that
${\begin{aligned}\lim _{\delta \to 0}\det(b^{2}A_{1}^{*}A_{1}-a^{2}A_{2}^{*}A_{2}+\delta I_{n})/\det(\delta I_{n-k})&=0,\\a^{2}+b^{2}&=1,\\a,b&\geq 0.\end{aligned}}$We have
* $A_{i}A_{j}^{*}=U_{i}\Sigma _{i}YY^{*}\Sigma _{j}^{*}U_{j}^{*}$
* $A_{i}^{*}A_{j}=Q{\begin{bmatrix}Y^{*}\Sigma _{i}^{*}\Sigma _{j}Y&0\\0&0\end{bmatrix}}Q^{*}=Q_{1}Y^{*}\Sigma _{i}^{*}\Sigma _{j}YQ_{1}^{*}$
By these properties we can show that the generalized singular values are exactly the pairs $(\alpha _{i},\beta _{i})$. We have${\begin{aligned}&\det(b^{2}A_{1}^{*}A_{1}-a^{2}A_{2}^{*}A_{2}+\delta I_{n})\\=&\det(b^{2}A_{1}^{*}A_{1}-a^{2}A_{2}^{*}A_{2}+\delta QQ^{*})\\=&\det \left(Q{\begin{bmatrix}Y^{*}(b^{2}\Sigma _{1}^{*}\Sigma _{1}-a^{2}\Sigma _{2}^{*}\Sigma _{2})Y+\delta I_{k}&0\\0&\delta I_{n-k}\end{bmatrix}}Q^{*}\right)\\=&\det(\delta I_{n-k})\det(Y^{*}(b^{2}\Sigma _{1}^{*}\Sigma _{1}-a^{2}\Sigma _{2}^{*}\Sigma _{2})Y+\delta I_{k}).\end{aligned}}$Therefore
    ${\begin{aligned}&\lim _{\delta \to 0}\det(b^{2}A_{1}^{*}A_{1}-a^{2}A_{2}^{*}A_{2}+\delta I_{n})/\det(\delta I_{n-k})\\=&\lim _{\delta \to 0}\det(Y^{*}(b^{2}\Sigma _{1}^{*}\Sigma _{1}-a^{2}\Sigma _{2}^{*}\Sigma _{2})Y+\delta I_{k})\\=&\det(Y^{*}(b^{2}\Sigma _{1}^{*}\Sigma _{1}-a^{2}\Sigma _{2}^{*}\Sigma _{2})Y)\\=&|\det(Y)|^{2}\prod _{i=1}^{k}(b^{2}\alpha _{i}^{2}-a^{2}\beta _{i}^{2}).\end{aligned}}$
This expression is zero exactly when $a=\alpha _{i}$ and $b=\beta _{i}$ for some $i$.
In, the generalized singular values are claimed to be those which solve $\det(b^{2}A_{1}^{*}A_{1}-a^{2}A_{2}^{*}A_{2})=0$. However, this claim only holds when $k=n$, since otherwise the determinant is zero for every pair $(a,b)\in \mathbb {R} ^{2}$; this can be seen by substituting $\delta =0$ above.

### Generalized inverse

Define $E^{+}=E^{-1}$ for any invertible matrix $E\in \mathbb {F} ^{n\times n}$ , $0^{+}=0^{*}$ for any zero matrix $0\in \mathbb {F} ^{m\times n}$, and $\left\lceil E_{1},E_{2}\right\rfloor ^{+}=\left\lceil E_{1}^{+},E_{2}^{+}\right\rfloor$ for any block-diagonal matrix. Then define$A_{i}^{+}=Q{\begin{bmatrix}Y^{-1}\\0\end{bmatrix}}\Sigma _{i}^{+}U_{i}^{*}$It can be shown that $A_{i}^{+}$ as defined here is a generalized inverse of $A_{i}$; in particular a $\{1,2,3\}$-inverse of $A_{i}$. Since it does not in general satisfy $(A_{i}^{+}A_{i})^{*}=A_{i}^{+}A_{i}$, this is not the Moore–Penrose inverse; otherwise we could derive $(AB)^{+}=B^{+}A^{+}$ for any choice of matrices, which only holds for certain class of matrices.
Suppose $Q={\begin{bmatrix}Q_{1}&Q_{2}\end{bmatrix}}$, where $Q_{1}\in \mathbb {F} ^{n\times k}$ and $Q_{2}\in \mathbb {F} ^{n\times (n-k)}$. This generalized inverse has the following properties:
* $\Sigma _{1}^{+}=\lceil I_{A},S_{1}^{-1},0_{A}^{T}\rfloor$
* $\Sigma _{2}^{+}=\lceil 0_{B}^{T},S_{2}^{-1},I_{B}\rfloor$
* $\Sigma _{1}\Sigma _{1}^{+}=\lceil I,I,0\rfloor$
* $\Sigma _{2}\Sigma _{2}^{+}=\lceil 0,I,I\rfloor$
* $\Sigma _{1}\Sigma _{2}^{+}=\lceil 0,S_{1}S_{2}^{-1},0\rfloor$
* $\Sigma _{1}^{+}\Sigma _{2}=\lceil 0,S_{1}^{-1}S_{2},0\rfloor$
* $A_{i}A_{j}^{+}=U_{i}\Sigma _{i}\Sigma _{j}^{+}U_{j}^{*}$
* $A_{i}^{+}A_{j}=Q{\begin{bmatrix}Y^{-1}\Sigma _{i}^{+}\Sigma _{j}Y&0\\0&0\end{bmatrix}}Q^{*}=Q_{1}Y^{-1}\Sigma _{i}^{+}\Sigma _{j}YQ_{1}^{*}$

### Quotient SVD

A generalized singular ratio of $A_{1}$ and $A_{2}$ is $\sigma _{i}=\alpha _{i}\beta _{i}^{+}$. By the above properties, $A_{1}A_{2}^{+}=U_{1}\Sigma _{1}\Sigma _{2}^{+}U_{2}^{*}$. Note that $\Sigma _{1}\Sigma _{2}^{+}=\lceil 0,S_{1}S_{2}^{-1},0\rfloor$ is diagonal, and that, ignoring the leading zeros, contains the singular ratios in decreasing order. If $A_{2}$ is invertible, then $\Sigma _{1}\Sigma _{2}^{+}$ has no leading zeros, and the generalized singular ratios are the singular values, and $U_{1}$ and $U_{2}$ are the matrices of singular vectors, of the matrix $A_{1}A_{2}^{+}=A_{1}A_{2}^{-1}$. In fact, computing the SVD of $A_{1}A_{2}^{-1}$ is one of the motivations for the GSVD, as "forming $AB^{-1}$ and finding its SVD can lead to unnecessary and large numerical errors when $B$ is ill-conditioned for solution of equations". Hence the sometimes used name "quotient SVD", although this is not the only reason for using GSVD. If $A_{2}$ is not invertible, then $U_{1}\Sigma _{1}\Sigma _{2}^{+}U_{2}^{*}$is still the SVD of $A_{1}A_{2}^{+}$ if we relax the requirement of having the singular values in decreasing order. Alternatively, a decreasing order SVD can be found by moving the leading zeros to the back: $U_{1}\Sigma _{1}\Sigma _{2}^{+}U_{2}^{*}=(U_{1}P_{1})P_{1}^{*}\Sigma _{1}\Sigma _{2}^{+}P_{2}(P_{2}^{*}U_{2}^{*})$, where $P_{1}$ and $P_{2}$ are appropriate permutation matrices. Since rank equals the number of non-zero singular values, $\mathrm {rank} (A_{1}A_{2}^{+})=s$.

### Construction

Let
* $C=P\lceil D,0\rfloor Q^{*}$ be the SVD of $C={\begin{bmatrix}A_{1}\\A_{2}\end{bmatrix}}$, where $P\in \mathbb {F} ^{(m_{1}+m_{2})\times (m_{1}\times m_{2})}$ is unitary, and $Q$ and $D$ are as described,
* $P=[P_{1},P_{2}]$, where $P_{1}\in \mathbb {F} ^{(m_{1}+m_{2})\times k}$ and $P_{2}\in \mathbb {F} ^{(m_{1}+m_{2})\times (n-k)}$,
* $P_{1}={\begin{bmatrix}P_{11}\\P_{21}\end{bmatrix}}$, where $P_{11}\in \mathbb {F} ^{m_{1}\times k}$ and $P_{21}\in \mathbb {F} ^{m_{2}\times k}$,
* $P_{11}=U_{1}\Sigma _{1}W^{*}$ by the SVD of $P_{11}$, where $U_{1}$, $\Sigma _{1}$ and $W$ are as described,
* $P_{21}W=U_{2}\Sigma _{2}$ by a decomposition similar to a QR-decomposition, where $U_{2}$ and $\Sigma _{2}$ are as described.
Then${\begin{aligned}C&=P\lceil D,0\rfloor Q^{*}\\&=[P_{1}D,0]Q^{*}\\&={\begin{bmatrix}U_{1}\Sigma _{1}W^{*}D&0\\U_{2}\Sigma _{2}W^{*}D&0\end{bmatrix}}Q^{*}\\&={\begin{bmatrix}U_{1}\Sigma _{1}[W^{*}D,0]Q^{*}\\U_{2}\Sigma _{2}[W^{*}D,0]Q^{*}\end{bmatrix}}.\end{aligned}}$We also have${\begin{bmatrix}U_{1}^{*}&0\\0&U_{2}^{*}\end{bmatrix}}P_{1}W={\begin{bmatrix}\Sigma _{1}\\\Sigma _{2}\end{bmatrix}}.$Therefore$\Sigma _{1}^{*}\Sigma _{1}+\Sigma _{2}^{*}\Sigma _{2}={\begin{bmatrix}\Sigma _{1}\\\Sigma _{2}\end{bmatrix}}^{*}{\begin{bmatrix}\Sigma _{1}\\\Sigma _{2}\end{bmatrix}}=W^{*}P_{1}^{*}{\begin{bmatrix}U_{1}&0\\0&U_{2}\end{bmatrix}}{\begin{bmatrix}U_{1}^{*}&0\\0&U_{2}^{*}\end{bmatrix}}P_{1}W=I.$Since $P_{1}$ has orthonormal columns, $||P_{1}||_{2}\leq 1$. Therefore$||\Sigma _{1}||_{2}=||U_{1}^{*}P_{1}W||_{2}=||P_{1}||_{2}\leq 1.$We also have for each $x\in \mathbb {R} ^{k}$ such that $||x||_{2}=1$ that$||P_{21}x||_{2}^{2}\leq ||P_{11}x||_{2}^{2}+||P_{21}x||_{2}^{2}=||P_{1}x||_{2}^{2}\leq 1.$Therefore $||P_{21}||_{2}\leq 1$, and$||\Sigma _{2}||_{2}=||U_{2}^{*}P_{21}W||_{2}=||P_{21}||_{2}\leq 1.$

## Applications

The GSVD, formulated as a comparative spectral decomposition, has been successfully applied to signal processing and data science, e.g., in genomic signal processing.
These applications inspired several additional comparative spectral decompositions, i.e., the higher-order GSVD (HO GSVD) and the tensor GSVD.
It has equally found applications to estimate the spectral decompositions of linear operators when the eigenfunctions are parameterized with a linear model, i.e. a reproducing kernel Hilbert space.

## Second version: weighted single-matrix decomposition

The weighted version of the generalized singular value decomposition (GSVD) is a constrained matrix decomposition with constraints imposed on the left and right singular vectors of the singular value decomposition. This form of the GSVD is an extension of the SVD as such. Given the SVD of an m×n real or complex matrix M
    $M=U\Sigma V^{*}\,$
where
    $U^{*}W_{u}U=V^{*}W_{v}V=I.$
Where I is the identity matrix and where $U$ and $V$ are orthonormal given their constraints ($W_{u}$ and $W_{v}$). Additionally, $W_{u}$ and $W_{v}$ are positive definite matrices (often diagonal matrices of weights). This form of the GSVD is the core of certain techniques, such as generalized principal component analysis and Correspondence analysis.
The weighted form of the GSVD is called as such because, with the correct selection of weights, it generalizes many techniques (such as multidimensional scaling and linear discriminant analysis).