[Math] Linear algebra: Gram-Schmidt process and QR factorization of a matrix

linear algebramatricesmatrix decomposition

I first start out with the following matrix:

\begin{pmatrix}
1 & -2 & -5 \\
0 & 1 & 3 \\
-5 & 2 & 2
\end{pmatrix}

I then used the Gram-Schmidt process to get:

\begin{pmatrix}
\frac{1}{\sqrt26} & \frac{-4}{3} \sqrt{\frac{5}{13}} & \frac{\sqrt{2.5}}{3} \\
0 & \frac{\sqrt{65}}{15} & \frac{8 \sqrt{0.1}}{3} \\
\frac{-5}{\sqrt26} & \frac{-4 \sqrt{\frac{5}{13}}}{15} & \frac{\sqrt{10}}{30}
\end{pmatrix}

Wolfram Alpha says otherwise. In fact, after calculating the decimal values, I realized this is the result Wolfram gives for the transpose of this matrix. Is there a convention, does it matter if I use the column vectors rather than the rows? I felt everything in my class has always been about the columns. Does it matter which I choose? I know this process is used as the first stop for the QR factorization, which I need to do on my exam tomorrow!

I've never done a QR factorization before. Is there a calculator that I can use to check my result? Could you recommend a tutorial on the QR factorization? That was going to be my second step, but I want to make sure I have the Gram-Schmidt process down first!

Thank you for your help!

Best Answer

As told by @ArtificialBreeze in the comments on this question (I recommend reading these comments), the choice of whether to assume column vectors or row vectors is arbitrary, just be consistent with what you have already done.

Now for the QR! If you have already done the Gram-Schmidt process (or otherwise have an orthonormal basis), then now the last step is easy (but very tedious, as usual).

The QR factorization states that $A = QR$, where A is your orginal matrix (the very first matrix in the question, in my case). Q is the orthonormal one, easily obtained by the Gram-Schmidt process (my second matrix above).

Now for the fun trick! A property of an orthonormal basis is the fact that $Q^{-1}$ = $Q^T$. So simply transpose your matrix to get $Q^{-1}$. Then multiply both sides by the transposed matrix, and you will have $Q^{-1}A = R$, now simply solve for R. You can then multiply out $QR$ to check your answer. Since there are so many operations, I would recommend that step, to check your answer.

You may also see the whole process, in full, from start to finish, here in this nice, concise video. It helped me!

Thank you everyone who commented and helped me out! I hope this helps others!

Related Question