I know how to do QR decomposition. Given that I can decompose a given metrix M into Q and R.
My question is how can I compute KR where K is upper trangular and R is orthonormal matrix for a given matrix (lets say 3×3), I want to know how we can do that on paper.
I would appriciate if you could please help me to understand this.
I'll modify the notation a bit. Intead of $A = KR$, I'll use $A = K Q'$, where $K$ is upper triangular and $Q'$ is an orthogonal matrix.
Given a matrix $A$, define $C$ a matrix which has $1$'s on the diagonal extending from the upper right corner to the lower left corner, and $0$'s otherwise. Form
$ B = C A C $
Perform $Q R$ of $B^T$, then
$ B^T = ( C A C )^T = Q R $
Apply the transpose operation to the equation, then
$ C A C = R^T Q^T $
The inverse of $C$ is $C$ itself. So
$ A = C R^T Q^T C = (C R^T C) (C Q^T C) $
$R^T$ is lower triangular, so $C R^T C$ is upper triangular. And $C Q^T C$ is an orthogonal matrix. Therefore, $K = C R^T C $ and $Q' = C Q^T C$.
The OP has mentioned (in the comments below) another method, to obtain $K$ and $Q'$ which is as follows:
$QR$ Factorize $A^{-1}$, so that
$ A^{-1} = Q_1 R_1 $
Then, by inverting the above, we get
$ A = R_1^{-1} Q_1^T $
Since the inverse of an upper triangular matrix is also upper triangular, and $Q_1^T$ is orthogonal, we're done, so we have
$ A = K_2 Q_2 $
where $K_2 = R_1^{-1} $ and $ Q_2 = Q_1^T $
I am going to show now, that these matrices are the same as $K$ and $Q'$ obtained above with the first method.
We have
$ B^T = C A^T C = Q R $
So
$ A^T = C Q R C $
And therefore,
$ A = C R^T Q^T C $
So that
$ A^{-1} = C Q R^{-T} C \hspace{15pt}(*)$
Now we have to compare this with,
$ A^{-1} = Q_1 R_1 \hspace{15pt}(**)$
Remember that $R_1$ is supposed to be upper triangular, so we have to modify $(*)$ to
$ A^{-1} = C Q C C R^{-T} C = ( C Q C ) ( C R^{-T} C )$
Now it is the correct format since $(C R^{-T} C) $ is upper triangular. So now we identify $Q_1 = C Q C $, and $R_1 = C R^{-T} C $
but $K_2 = R_1^{-1} $ and $ Q_2 = Q_1^T $, hence
$ K_2 = C R^T C = K $ and $ Q_2 = C Q^T C = Q' $
This proves the equivalence of the two methods.