Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
QR decomposition
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Using the Gram–Schmidt process=== {{further|Gram–Schmidt#Numerical stability}} Consider the [[Gram–Schmidt process]] applied to the columns of the full column rank matrix {{nowrap|<math>A = \begin{bmatrix}\mathbf{a}_1 & \cdots & \mathbf{a}_n\end{bmatrix}</math>,}} with [[inner product]] <math>\langle\mathbf{v}, \mathbf{w}\rangle = \mathbf{v}^\textsf{T} \mathbf{w}</math> (or <math>\langle\mathbf{v}, \mathbf{w}\rangle = \mathbf{v}^\dagger \mathbf{w}</math> for the complex case). Define the [[vector projection|projection]]: :<math>\operatorname{proj}_{\mathbf{u}}\mathbf{a} = \frac{\left\langle\mathbf{u}, \mathbf{a}\right\rangle}{\left\langle\mathbf{u}, \mathbf{u}\right\rangle}{\mathbf{u}} </math> then: :<math>\begin{align} \mathbf{u}_1 &= \mathbf{a}_1, & \mathbf{e}_1 &= \frac{\mathbf{u}_1}{\|\mathbf{u}_1\|} \\ \mathbf{u}_2 &= \mathbf{a}_2 - \operatorname{proj}_{\mathbf{u}_1} \mathbf{a}_2, & \mathbf{e}_2 &= \frac{\mathbf{u}_2}{\|\mathbf{u}_2\|} \\ \mathbf{u}_3 &= \mathbf{a}_3 - \operatorname{proj}_{\mathbf{u}_1} \mathbf{a}_3 - \operatorname{proj}_{\mathbf{u}_2} \mathbf{a}_3, & \mathbf{e}_3 &= \frac{\mathbf{u}_3}{\|\mathbf{u}_3\|} \\ & \;\; \vdots & & \;\; \vdots \\ \mathbf{u}_k &= \mathbf{a}_k - \sum_{j=1}^{k-1}\operatorname{proj}_{\mathbf{u}_j} \mathbf{a}_k,& \mathbf{e}_k &= \frac{\mathbf{u}_k}{\|\mathbf{u}_k\|} \end{align}</math> We can now express the <math>\mathbf{a}_i</math>s over our newly computed orthonormal basis: :<math>\begin{align} \mathbf{a}_1 &= \left\langle\mathbf{e}_1, \mathbf{a}_1\right\rangle \mathbf{e}_1 \\ \mathbf{a}_2 &= \left\langle\mathbf{e}_1, \mathbf{a}_2\right\rangle \mathbf{e}_1 + \left\langle\mathbf{e}_2, \mathbf{a}_2\right\rangle \mathbf{e}_2 \\ \mathbf{a}_3 &= \left\langle\mathbf{e}_1, \mathbf{a}_3\right\rangle \mathbf{e}_1 + \left\langle\mathbf{e}_2, \mathbf{a}_3\right\rangle \mathbf{e}_2 + \left\langle\mathbf{e}_3, \mathbf{a}_3\right\rangle \mathbf{e}_3 \\ &\;\;\vdots \\ \mathbf{a}_k &= \sum_{j=1}^k \left\langle \mathbf{e}_j, \mathbf{a}_k \right\rangle \mathbf{e}_j \end{align}</math> where {{nowrap|<math>\left\langle\mathbf{e}_i, \mathbf{a}_i\right\rangle = \left\|\mathbf{u}_i\right\|</math>.}} This can be written in matrix form: :<math>A = QR</math> where: :<math>Q = \begin{bmatrix}\mathbf{e}_1 & \cdots & \mathbf{e}_n\end{bmatrix}</math> and :<math>R = \begin{bmatrix} \langle\mathbf{e}_1, \mathbf{a}_1\rangle & \langle\mathbf{e}_1, \mathbf{a}_2\rangle & \langle\mathbf{e}_1, \mathbf{a}_3\rangle & \cdots & \langle\mathbf{e}_1, \mathbf{a}_n\rangle \\ 0 & \langle\mathbf{e}_2, \mathbf{a}_2\rangle & \langle\mathbf{e}_2, \mathbf{a}_3\rangle & \cdots & \langle\mathbf{e}_2, \mathbf{a}_n\rangle \\ 0 & 0 & \langle\mathbf{e}_3, \mathbf{a}_3\rangle & \cdots & \langle\mathbf{e}_3, \mathbf{a}_n\rangle \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & \langle\mathbf{e}_n, \mathbf{a}_n\rangle \\ \end{bmatrix}.</math> ====Example==== Consider the decomposition of : <math>A = \begin{bmatrix} 12 & -51 & 4 \\ 6 & 167 & -68 \\ -4 & 24 & -41 \end{bmatrix}.</math> Recall that an orthonormal matrix <math>Q</math> has the property {{nowrap|<math>Q^\textsf{T} Q = I</math>.}} Then, we can calculate <math>Q</math> by means of Gram–Schmidt as follows: : <math>\begin{align} U = \begin{bmatrix} \mathbf u_1 & \mathbf u_2 & \mathbf u_3 \end{bmatrix} &= \begin{bmatrix} 12 & -69 & -58/5 \\ 6 & 158 & 6/5 \\ -4 & 30 & -33 \end{bmatrix}; \\ Q = \begin{bmatrix} \frac{\mathbf u_1}{\|\mathbf u_1\|} & \frac{\mathbf u_2}{\|\mathbf u_2\|} & \frac{\mathbf u_3}{\|\mathbf u_3\|} \end{bmatrix} &= \begin{bmatrix} 6/7 & -69/175 & -58/175 \\ 3/7 & 158/175 & 6/175 \\ -2/7 & 6/35 & -33/35 \end{bmatrix}. \end{align}</math> Thus, we have : <math>\begin{align} Q^\textsf{T} A &= Q^\textsf{T}Q\,R = R; \\ R &= Q^\textsf{T}A = \begin{bmatrix} 14 & 21 & -14 \\ 0 & 175 & -70 \\ 0 & 0 & 35 \end{bmatrix}. \end{align}</math> ====Relation to RQ decomposition==== The RQ decomposition transforms a matrix ''A'' into the product of an upper triangular matrix ''R'' (also known as right-triangular) and an orthogonal matrix ''Q''. The only difference from QR decomposition is the order of these matrices. QR decomposition is Gram–Schmidt orthogonalization of columns of ''A'', started from the first column. RQ decomposition is Gram–Schmidt orthogonalization of rows of ''A'', started from the last row. ====Advantages and disadvantages==== The Gram-Schmidt process is inherently numerically unstable. While the application of the projections has an appealing geometric analogy to orthogonalization, the orthogonalization itself is prone to numerical error. A significant advantage is the ease of implementation.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)