Why are the angles between columns of $A$ the same as angles between the columns of $R$ when $A=QR$ and $A^\top A=R^\top R$?

104 Views Asked by At

Suppose a matrix $A$ has linearly independent columns and QR factorization $A = QR$.

I was able to prove that $A^\top A = R^\top R$.

$$G = A^\top A = (QR)^\top(QR) = R^\top Q^\top QR = R^\top (Q^\top Q)R = R^\top R.$$

Apparently it is true that the angles between columns $i,j$ of $A$ are equivalent to the angles between columns $i,j$ of $R$, but I've double checked my reading and can't seem to figure out why.

I'm guessing it may have something to do with norms. I recall that angle $\theta$ between two vectors $x$ and $y$ is $$\theta = \arccos\frac{x^\top y}{\|x\|\|y\|}$$ and know how the Gram matrix is formed simply using inner-products, but haven't been able to find a connection yet.

3

There are 3 best solutions below

0
On

You are very close. Note that, for any matrix $B$, the Gram matrix for the columns of $B$ is just $B^\top B$; you can verify this using the definition of matrix multiplication.

If $v_1, \ldots v_n$ are the column vectors of $A$, and $\theta_{ij}$ is the angle between $v_i$ and $v_j$, then according to your formula, $$\theta_{ij} = \arccos\frac{v_i^\top v_j}{\sqrt{v_i^\top v_i} \sqrt{v_j^\top v_j}} = \arccos\frac{(A^\top A)_{ij}}{\sqrt{(A^\top A)_{ii}} \sqrt{(A^\top A)_{jj}}}.$$ This is true, since $A^\top A$ is the gram matrix for $v_1, \ldots, v_n$.

Correspondingly, if $w_1, \ldots, w_n$ are the columns of $R$, with $\psi_{ij}$ being the angle between $w_i$ and $w_j$, we similarly see

$$\psi_{ij} = \arccos\frac{(R^\top R)_{ij}}{\sqrt{(R^\top R)_{ii}} \sqrt{(R^\top R)_{jj}}} = \arccos\frac{(A^\top A)_{ij}}{\sqrt{(A^\top A)_{ii}} \sqrt{(A^\top A)_{jj}}} = \theta_{ij}.$$

0
On

You have already found the answer. Since $A^{T} A = R^{T} R$, then for each index columns $i,j$, $A_i^{T} A_j = R_i^{T} R_j$ where $A_i$ and $R_i$ are the $i$-th column of $A$ and $R$ respectively. Moreover taking $i=j$ we have, $$||A_i|| = ||R_i||$$ for each $i$. So

$$ \frac{A_i^{T} A_j}{||A_i||\,||A_j||} = \frac{R_i^{T} R_j}{||R_i||\,||R_j||}.$$ This shows that the angles between columns of $A$ is the same as the angles between columns of $R$.

0
On

After $A^{T}A=R^{T}R\,\,$ there is not much left to prove. Take $A=\begin{pmatrix} v_{1} & v_{2} &.. & .. & v_{n} \\ \end{pmatrix}$ where $v_{1},..,v_{n}$ are the columns of $A$. Then

$A^{T}=\begin{pmatrix} v^{T}_{1} \\ v^{T}_{2} \\ .. \\ v^{T}_{n}\\ \end{pmatrix}$ and $\,\,A^{T}A$=$\begin{pmatrix} v_{1}^{T}v_{1} &v^{T}_{1}v_{2} &.. &.. &v_{1}^{T}v_{n} \\ v_{2}^{T}v_{1}&v^{T}_{2}v_{2} & .. &.. & v_{2}^{T}v_{n} \\ .. & . & . & . &. \\ .& . & . & . & . \\ v_{n}^{T}v_{1} &v_{n}^{T}v_{2} &. &. &v^{T}_{n}v_{n} \\ \end{pmatrix}$.

We write the same matrix for $R^{T}R$, and we notice that from the diagonal elements $\left\|v_{i} \right\|=\left\|r_{i} \right\|$ for $i=1,2,..,n$. Now take any inner product and notice that

$v^{T}_{i}v_{j}=r^{T}_{i}r_{j}$ and since we have shown norms of $v'$s

and $r's$ are equal we get $cos\theta_{1}(i,j)=$cos$\theta_{2}(i,j)$ and we are done!!