QR decomposition of a matrix is otherwise known as QR factorization, which is nothing but decomposition of a matrix into an orthogonal matrix i.e product A = QR, and an upper triangular matrix R.
Consider 3 x 3 Matrix
A = |
|
First, split the columns of the given matrix.
V1 = | 12 6 -4 |
V2 = | -51 167 24 |
V3 = | -4 68 -41 |
Let us calculate the values of R using Gram - Schmidt process.
u1 = v1
u2 = v2 - proju1 v2
. . .
uk = vk - proju1 vk - proju2 vk - ... - projuk-1 vk
projuj vk = (v,u) u /(u,u)
Substitute the values in Gram - Schmidt process,
u1 = | 12 6 -4 |
u2 = | -51 167 24 |
- | proju1 v2 |
u2 = | -51 167 24 |
- | (v,u) u /(u,u) |
Finding (v,u) and (u,u) values | |||
(v,u) = | -51 167 24 |
12 6 -4 |
= (-612+1002-96) = 294 |
(u,u) = | 12 6 -4 |
12 6 -4 |
= (144+36+16) = 196 |
u2 = | -51 167 24 |
- | (294/196) 12 6 -4 |
u2 = | -51 167 24 |
- | 1.5 12 6 -4 |
u2 = | -51 167 24 |
- | 18 9 -6 |
u2 = | -69 158 30 |
Follow the same steps and calculate u3 matrix value,
Calculate the values of ||u1||, ||u2||, ||u3||
Q = (u1/||u1||, u2/||u2||, u3/||u3||)
||u1|| = √122 + 62 + (-4)2 = √196 = 14Finally calculate the value of R
Q =