The calculation process of one-sided Jacobi SVD method is as follows:
- Initialize matrix V = I
- Select two columns (i, j), i < j, of matrix A, namely \(A_i\) and \(A_j\). Accumulate two columns of data by fomular
\[\begin{split}&b_{ii} = A_i^TA_i = ||A_i||^2 \\
&b_{jj} = A_j^TA_j = ||A_j||^2 \\
&b_{ij} = A_i^TA_j\end{split}\]
A \(2 \times 2\) matrix can be obtained and noted as:
\[\begin{split}\begin{bmatrix}
b_{ii}\ b_{ij}\\
b_{ji}\ b_{jj}\\
\end{bmatrix}\end{split}\]
where \(b_{ij}\) equals \(b_{ji}\).
- Solve the \(2 \times 2\) symmetric SVD with Jacobi rotation:
\[\begin{split}&\tau = (b_{ii} - b_{jj}) / (2 * b_{ij})) \\
&t = sign(\tau)/(|\tau| + \sqrt{(1 + \tau^2)}) \\
&c = 1 / \sqrt{(1+t^2)} \\
&s = c * t \\\end{split}\]
if we put s and c in a matrix as J, then J equals
\[\begin{split}\begin{bmatrix}
1\ \ \ \ \ 0\ ...\ 0\ \ 0\ \\
0\ \ \ \ \ c\ ...\ s\ \ 0\ \\
0\ \ \ \ \ 0\ ...\ 0\ \ 0\ \\
0\ -s\ ...\ c\ \ 0\ \\
0\ \ \ \ \ 0\ ...\ 0\ \ 1\ \\
\end{bmatrix}\end{split}\]
- Update the i and j columns of matrix A and V by
\[\begin{split}A = A J\\
V = V J\end{split}\]
- Calculate converage of \(2 \times 2\) matrix by
\[conv = |b_{ij}| / \sqrt{(b_{ii}b_{jj})}\]
and select the max converage of all pairs (i, j).
- Repeat steps 2-4 until all pairs of (i, j) are calculated and updated.
- If the max converage among all paris of (i, j) is bigger than 1.e-8, repeat steps 2-6 again, which is also called one sweep.
- When the converge is small enough, calculate the matrix U and S for each \(i = 1, ..., n\) by
\[\begin{split}&s_i =||a_i||_2 \\
&u_i = a_i / s_i\end{split}\]