To understand why the QR factorization works lets take a closer look at the

# To understand why the qr factorization works lets

• Notes
• 102
• 100% (5) 5 out of 5 people found this document helpful

This preview shows page 88 - 91 out of 102 pages.

To understand why the QR factorization works let’s take a closer look at the product: QR = bracketleftbig q 1 ... q i ... q n bracketrightbig r 11 r 12 ... r 1 i ... r 1 n 0 r 22 ... r 2 i ... r 2 n . . . . . . . . . . . . . . . . . . 0 0 ... r ii ... r in . . . . . . ... . . . . . . . . . 0 0 ... 0 ... r nn = bracketleftBigg r 11 q 1 ... r 1 i q 1 + r 2 i q 2 + · · · + r i - 1 ,i q i - 1 bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright p i - 1 + r ii q i ... r 1 n q 1 + r 2 n q 2 + · · · + r n - 1 ,n q n - 1 bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright p n - 1 + r nn q n bracketrightBigg = bracketleftbig a 1 ... p i - 1 + r ii q i ... p n - 1 + r nn q n bracketrightbig = bracketleftbigg a 1 ... p i - 1 + bardbl a i p i - 1 bardbl a i p i - 1 bardbl a i p i - 1 bardbl ... p n - 1 + bardbl a n p n - 1 bardbl a n p n - 1 bardbl a n p n - 1 bardbl bracketrightbigg = bracketleftbig a 1 ... a i ... a n bracketrightbig = A EXAMPLE: Find the QR factorization of A = 12 21 6 0 4 14 . Solution: r 11 = || a 1 || = 14 , q 1 = a 1 || a 1 || = parenleftbigg 6 7 , 3 7 , 2 7 parenrightbigg T r 12 = < a 2 , q 1 > = 14 p 1 = r 12 q 1 = (12 , 6 , 4) T (projection of a 2 onto q 1 ). r 22 = || a 2 p 1 || = vextenddouble vextenddouble vextenddouble (9 , 6 , 18) T vextenddouble vextenddouble vextenddouble = 441 = 21 q 2 = a 2 p 1 r 22 = parenleftbigg 3 7 , 2 7 , 6 7 parenrightbigg T Q = 6 / 7 3 / 7 3 / 7 2 / 7 2 / 7 6 / 7 , R = bracketleftbigg 14 14 0 21 bracketrightbigg . We can easily check that QR = A . NOTE: The QR factorization is unique if we require the diagonal elements of R to be positive .
5.6 3 THEOREM 5.6.3: THE LEAST SQUARES AND QR Let A be an m × n matrix of rank n , the the normal equations for the least squares problem A x = b reduce to R x = Q T b , where Q and R are the matrices obtained from the QR factorization. The solution ˆ x must be obtained by using back substitution. Proof: ˆ x satisfies the normal equations: A T A ˆ x = A T b Substituting A = QR yields ( QR ) T ( QR x = ( QR ) T b R T Q T QR ˆ x = R T Q T x The columns of Q are orthonormal, thus Q T Q = I , and R T R ˆ x = R T Q T b R is n × n upper triangular with diagonal entries not zero, thus det( R ) = det( R T ) negationslash = 0 and the inverse of R T exists. Multiplying both sides by this inverse, gives R ˆ x = Q T b squaresolid NOTE: Using the QR factorization and back substitution to find the least squares solution is much more computationally efficient and accurate then using the normal equations. EXAMPLE: Let A = 12 21 6 0 4 14 and b = 1 0 2 . Find the least square solution using the QR factorization (solving the system by back substitution). Solution: We already found the QR factorization in the previous example. The system R x = Q T b , is 14 x 1 14 x 2 = 10 7 21 x 2 = 9 7 Solving by backsubstitution gives x 1 = 8 49 and x 2 = 3 49 .
6.1 1 § 6.1 Eigenvalues and Eigenvectors Eigenvalues and Eigenvectors Introduction: To explain eigenvalues, we first explain eigenvectors. Almost all vectors change direction, when they are multiplied by A . Certain exceptional vectors x are in the same direction as A x.