About the Generalized singular value decomposition (GSVD). I have studied about Singular value decomposition (SVD) and had solved few numerical examples  to understand SVD. Now I am studying Generalized singular value decomposition  (GSVD). I followed this link to grasp the concept of GSVD but I haven't been able to understand. I have failed in finding any numerical example based on GSVD. 
I need help to to understand GSVD. Any numerical example based on GSVD will be very much helpful to me.
Thank you very much.
 A: There are several papers about the GSVD, the most useful ones (for me) were Paige and Saunders, Chu et al., Van Loan, Kagstrom and for an example application see Kempf et al. (free). A reference book is Matrix Computations from Golub and Van Loan.
Recently, a higher-order GSVD was developed see Ponnapalli et al. and Kempf et al. (free), which works for more than two matrices.
In essence, given two matrices $A_1$ and $A_2$ with equal number of columns, then the GSVD factorizes each matrix as $A_i=U_i\Sigma_i V^T$, where $U_i$ is orthogonal, $\Sigma_i\succeq 0$ diagonal and $V$, which is shared among the factorizations, invertible. In addition, $\Sigma_1^2+\Sigma_2^2=I$. In case that $A_2=I$, the GSVD gives you the SVD of $A_1$ (hence the generalized SVD).
You can quite straightforwardly try to compute it yourself, e.g. in Matlab. These are the steps:

*

*Compute $S=\frac{1}{2}(A_1^TA_1(A_2^TA_2)^{-1}+A_2^TA_2(A_1^TA_1)^{-1})$

*Compute the eigenvector matrix of $S$ s.t. $SV=V\Lambda$, with $\Lambda$ being the eigenvalues of $S$

*Compute $B_i=A_i(V^T)^{-1}$

*If $B_i=[b_{i,1},\dots,b_{i,n}]$, where $b_{i,j}$ denotes a column of $B_i$, then normalize each column of $B_i$ to obtain $U_i$ and set $\Sigma_i = \text{diag}(||b_{i,1}||_2,\dots,||b_{i,n}||_2)$
You should be able to obtain a numerical examples for e.g. $2\times 2$ matrices using the above yourself.
Find the details for this approach in Ponnapalli et al. or Kempf et al.. If you can't compute the inverse of some $A_i^TA_i$, then check the modification in Kempf et al..
Other approaches use a QR decomposition of the stacked $A_i$ and take a detour over the cosine-sine decomposition (CSD). Some algorithms might be favorable because they are numerically stable. The above one is clearly bad for ill-conditioned $A_i$ and can also be improved by using a QR decomposition of the stacked $A_i$.
