Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scientific Computing QR Factorization Part 1 – Orthogonal Matrices, Reflections and Rotations.

Similar presentations


Presentation on theme: "Scientific Computing QR Factorization Part 1 – Orthogonal Matrices, Reflections and Rotations."— Presentation transcript:

1 Scientific Computing QR Factorization Part 1 – Orthogonal Matrices, Reflections and Rotations

2 Orthogonal Matrices Matrix Factoring: So far, we have seen that we can factor a non-singular matrix A as A = LU, where L is lower triangular and U is upper triangular. QR Factoring: Similar idea to factor A = QR, where R is upper triangular and Q is orthogonal. Definition: A square matrix Q is orthogonal if Q t Q = I

3 Orthogonal Matrix Properties Multiplication of a vector by an orthogonal matrix preserves Euclidean norm In general, multiplication by an orthogonal matrix Q preserves inner products, angles, and distances.

4 Rotations Rotation matrices are one example of orthogonal matrices. In R 2 the matrix applied to a vector x rotates x counter- clockwise about the origin. θ v Qv

5 Rotations In general, the matrix acts as a rotation in the (x i,x j ) plane i j

6 Reflections Let w be a unit vector (column vector). The matrix acts as a reflection across the line (plane) perpendicular to w. w v Qv O

7 Householder Transformations A Householder transformation (also known as Householder reflection or elementary reflector) is a linear transformation that describes a reflection about a plane (or hyperplane ) containing the origin. The Householder transformation was introduced in 1958 by Alston Scott Householder. (Wikipedia)

8 Effect of Householder Transformations Householder transformations can be used to zero out entries of a matrix below the diagonal. Let A = [A 1 A 2 … A n ] be a square matrix, with columns A i. Let Let v 1 = A 1 – α 1 e 1 where e 1 =(1,0,….,0) Then,

9 Effect of Householder Transformations Now, let Then, w 1 is a unit vector. Thus, H 1 = I – 2 w 1 w 1 t is a reflection (Householder transf) The first column of H 1 A will be H 1 A 1.

10 Effect of Householder Transformations Thus,

11 QR Factorization Theorem: If A is any square matrix of size n, then, there is an orthogonal matrix Q, and an upper triangular matrix R, such that A = QR. Proof: The construction above shows that there is a Householder matrix H 1 such that the first column of H 1 A has zeros below the first entry. Proceed by induction. Suppose, after step k-1 we have found a series of matrices H 1, H 2, …, H k-1 such that H k-1 …H 2 H 1 A has all zeroes below the diagonal to position (k-1,k- 1).

12 QR Factorization

13 Proof:(continued). We will zero out the column below the (k,k) entry as follows: Let Then, Let Note: Thus, where I k is a kxk identity matrix.

14 QR Factorization Proof:(continued) We see that H k will only affect the lower (n-k)x(n-k) portion of the current matrix. Thus, as before, H k ( H k-1 …H 2 H 1 A ) will zero out the column below the (k,k) entry. Thus, we have by induction, that we can find a sequence fo Householder transformations such that ( H n-1 …H 2 H 1 A) = R, where R is upper triangular. Then, A = H 1 -1 H 2 -1 … H n-1 -1 R. Since H i -1 =H i, we have A = H 1 H 2 … H n-1 R. Let Q = H 1 H 2 … H n-1. Since Q is a product of orthogonal matrics, it is also orthogonal. QED.

15 QR Example To derive H 1 for the given matrix A : We have : Thus, So,

16 Example con’t Then, k=2:

17 Example con’t Then, So, A = H 1 H 2 R = Q R where

18 Example con’t From Matlab: >> A=[4 3 0; 2 1 2; 4 7 0]; >> [q r] = qr(A) q = 0.6667 -0.5270 -0.5270 0.3333 -0.4216 0.8433 0.6667 0.7379 0.1054 r = 6.0000 7.0000 0.6667 0 3.1623 -0.8433 0 0 1.6865 Note the slight difference between matlab’s result and our algorithm result. Matlab always uses α k values so that the diagonal of R has non- negative values.

19 QR Factorization Note: The factorization of A=QR is not unique!


Download ppt "Scientific Computing QR Factorization Part 1 – Orthogonal Matrices, Reflections and Rotations."

Similar presentations


Ads by Google