I compute the Singular Value Decomposition of a $n \times n$ matrix. If the matrix is not full rank, and I have 2 collinear columns, I end up with one singular value equal to 0. Is it possible to find out which columns of the original matrix are collinear from the result of the SVD ?
This is a simple example. I would then like, for a more complicated matrix where a group of columns are multicollinear, to identify this group.
Therefore I want to know if the SVD can go beyond just knowing the number of multicollinear columns and identifying the multicollinear group of columns.
You can do the following:
Compute the SVD of $A\in\mathbb{R}^{n\times n}$: $$ A=[U_1,U_2]\begin{bmatrix}\Sigma & 0 \\ 0 & 0\end{bmatrix}\begin{bmatrix}V_1^T \\ V_2^T\end{bmatrix}, $$ where $V_2\in\mathbb{R}^{n\times k}$, $k=\dim\mathcal{N}(A)$, is contains the orthonormal basis of the nullspace of $A$. Next, compute the QR factorization with pivoting of the matrix $V_2^T$ such that $$\tag{✽} V_2^T\Pi=QR=Q\begin{bmatrix}R_1 & R_2\end{bmatrix}, $$ where $\Pi$ is a permutation matrix and $R_1$ is nonsingular upper triangular matrix (e.g., MATLAB's
qrfunction with three output arguments can do it). From $AV_2=0$ and (✽), we have now $$ 0 = AV_2=A\Pi\Pi^TV_2=A\Pi(V_2^T\Pi)^T=A\Pi\begin{bmatrix}R_1^T \\ R_2^T\end{bmatrix}Q^T $$ and hence (since $Q$ is square and non-singular) $$\tag{☺} A\Pi\begin{bmatrix}R_1^T \\ R_2^T\end{bmatrix}=0. $$ Now partition $A\Pi$ as $A\Pi=[A_1,A_2]$ conformingly to the partitioning of $R$ to get from (☺) that $$ A_1R_1^T+A_2R_2^T=0, $$ therefore $$ A_1=-A_2R_2^TR_1^{-T}. $$ Consequently, the columns of $A_1$ can be written as linear combinations of the columns of $A_2$ (with the coefficients given by the matrix $-R_2^TR_1^{-T}$). Note that you don't need to compute these coefficients, but only to compute the pivoted QR factorization. The permutation matrix can then be directly used to identify these dependent columns.A simple MATLAB example:
The following matrix $A$ has rank 2:
Using
gives
Hence
Compute the QR factorisation of $V_2^T$ with pivoting:
We can see, that the columns 3 and 4 are dependent on the others (actually only the second one from the structure of $R_2$).