Review of QR algorithm

Here is a worked example to illustrate the use of the QR decomposition in solving a least squares equation.

For an tex2html_wrap_inline85 matrix X, we want to find an orthogonal (length preserving) matrix Q ( tex2html_wrap_inline89 ) such that tex2html_wrap_inline91 , where R is a block upper triangular matrix.

Take

displaymath95

then if Q is such that

displaymath99

you can verify that

displaymath101

which is block upper triangular as required.

To solve the least squares equation

displaymath103

we can equivalently solve

displaymath105

Take for example

displaymath107

then

displaymath109

displaymath111

displaymath113

displaymath115

So tex2html_wrap_inline117 and tex2html_wrap_inline119 . The residual is of length tex2html_wrap_inline121 , so that the RMSE = tex2html_wrap_inline123

Orthogonal matrix have the propery that tex2html_wrap_inline125 , so that tex2html_wrap_inline91 is equivalent to tex2html_wrap_inline129 , which is the way one usually sees the QR decomposition.

To summarize, the objective is to decompose a matrix X as tex2html_wrap_inline129 where X is tex2html_wrap_inline85 , Q is tex2html_wrap_inline85 and R is tex2html_wrap_inline143 upper triangular, with Q orthogonal.

The S-Plus code to produce these matrices is availble as qr.q.


next up previous
Next: Normal equations for linear Up: Class 5 Stat 540 Previous: Class 5 Stat 540

Richard Waterman
Fri Feb 12 06:43:38 EST 1999