I have two matrices $A$ and $B$ of dimension $n\times m$ which I would like to compare up to rearrangement of their columns. If I didn't care about rearranging columns, I could simply compute $\|A - B\|_F$.
Computing the Frobenius norm for each of the $m!$ possible permutations of rows clearly doesn't scale. Is there some metric/matrix decomposition that compares the column space of two matrices?
Ideas
- Perhaps I could find their SVDs $A = U_A\Sigma_A V_A^\top$ and $B = U_B \Sigma_B V_B^\top$ and compare the eigenvalues and the eigenvectors, which should have the same order (since the eigenvalues would be ordered in descending order).
- Ideally I would like to find bases $\{a_1, \ldots, a_m\}$ and $\{b_1, \ldots, b_m\}$ of $\text{col}(A)$ and $\text{col}(B)$ respectively and then compare these bases. Can we show $\text{col}(A) = \text{col}(B)$? Apparently, given the QR decomposition $A = Q_A R_A$ then the columns of $Q_A$ span the column space of $A$.