Top Banner
Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç University ˙ Istanbul, Turkey Emre Mengi Week 6, Lecture 2
30

Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Mar 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Math 504 Fall 2016 NotesWeek 6, Lecture 2

Emre Mengi

Department of MathematicsKoç University

Istanbul, Turkey

Emre Mengi Week 6, Lecture 2

Page 2: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Outline

QR Factorization

QR Factorization by Householder Triangularization

Emre Mengi Week 6, Lecture 2

Page 3: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

QR Factorization

Emre Mengi Week 6, Lecture 2

Page 4: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Let A ∈ Cn×p with n ≥ p.

The reduced QR factorization of A

A = QR

Q ∈ Cn×p has orthonormal columns, R ∈ Cp×p is uppertriangular.

The full QR factorization of A

A = QR

Q ∈ Cn×n is unitary, R ∈ Cn×p is upper triangular.

Emre Mengi Week 6, Lecture 2

Page 5: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Let A ∈ Cn×p with n ≥ p.

The reduced QR factorization of A

A = QR

Q ∈ Cn×p has orthonormal columns, R ∈ Cp×p is uppertriangular.

The full QR factorization of A

A = QR

Q ∈ Cn×n is unitary, R ∈ Cn×p is upper triangular.

Emre Mengi Week 6, Lecture 2

Page 6: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Let A ∈ Cn×p with n ≥ p.

The reduced QR factorization of A

A = QR

Q ∈ Cn×p has orthonormal columns, R ∈ Cp×p is uppertriangular.

The full QR factorization of A

A = QR

Q ∈ Cn×n is unitary, R ∈ Cn×p is upper triangular.

Emre Mengi Week 6, Lecture 2

Page 7: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Reduced QR factorization can be obtained from the full QRfactorization.

Let

A =

Q1︸︷︷︸n×p

Q2︸︷︷︸n×(n−p)

R1︸︷︷︸p×p0︸︷︷︸

(n−p)×p

be the full QR factorization.

ThenA = Q1R1

is the reduced QR factorization.

Emre Mengi Week 6, Lecture 2

Page 8: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Reduced QR factorization can be obtained from the full QRfactorization.

Let

A =

Q1︸︷︷︸n×p

Q2︸︷︷︸n×(n−p)

R1︸︷︷︸p×p0︸︷︷︸

(n−p)×p

be the full QR factorization.

ThenA = Q1R1

is the reduced QR factorization.

Emre Mengi Week 6, Lecture 2

Page 9: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Reduced and Full QR Factorizations

Reduced QR factorization can be obtained from the full QRfactorization.

Let

A =

Q1︸︷︷︸n×p

Q2︸︷︷︸n×(n−p)

R1︸︷︷︸p×p0︸︷︷︸

(n−p)×p

be the full QR factorization.

ThenA = Q1R1

is the reduced QR factorization.

Emre Mengi Week 6, Lecture 2

Page 10: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

QR Factorization and the Gram-Schmidt Procedure

The Gram-Schmidt procedure applied to the columns of

A =[

a(1) a(2) . . . a(p)]

can be expressed as

a(1) = r11q(1),

a(2) = r12q(1) + r22q(2),

...

a(p) = r1pq(1) + r2pq(2) + · · ·+ rppq(p).

Emre Mengi Week 6, Lecture 2

Page 11: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

QR Factorization and the Gram-Schmidt Procedure

Hence,

[a(1) a(2) . . . a(p)

]︸ ︷︷ ︸A

=[

q(1) q(2) . . . q(p)]︸ ︷︷ ︸

Q

r11 r12 . . . r1p0 r22 . . . r2p...

. . ....

0 0 rpp

︸ ︷︷ ︸

R

.

Gram-Schmidt procedure yields a reduced QR factorization.

Emre Mengi Week 6, Lecture 2

Page 12: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

QR Factorization and the Gram-Schmidt Procedure

Hence,

[a(1) a(2) . . . a(p)

]︸ ︷︷ ︸A

=[

q(1) q(2) . . . q(p)]︸ ︷︷ ︸

Q

r11 r12 . . . r1p0 r22 . . . r2p...

. . ....

0 0 rpp

︸ ︷︷ ︸

R

.

Gram-Schmidt procedure yields a reduced QR factorization.

Emre Mengi Week 6, Lecture 2

Page 13: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

QR Factorization by HouseholderTriangularization

Emre Mengi Week 6, Lecture 2

Page 14: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

For a given vector v ∈ Cn, would like a unitary matrix H ∈ Cn×n

such that

Hv = ‖v‖2e(1) =

‖v‖2

0...0

.

One possibility is the Householder reflector

H = In − 2uu∗

whereu = (v − ‖v‖2e(1))/‖v − ‖v‖2e(1)‖2.

H reflects about the subspace S⊥ where S = span{u}.

Emre Mengi Week 6, Lecture 2

Page 15: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

For a given vector v ∈ Cn, would like a unitary matrix H ∈ Cn×n

such that

Hv = ‖v‖2e(1) =

‖v‖2

0...0

.

One possibility is the Householder reflector

H = In − 2uu∗

whereu = (v − ‖v‖2e(1))/‖v − ‖v‖2e(1)‖2.

H reflects about the subspace S⊥ where S = span{u}.

Emre Mengi Week 6, Lecture 2

Page 16: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

For a given vector v ∈ Cn, would like a unitary matrix H ∈ Cn×n

such that

Hv = ‖v‖2e(1) =

‖v‖2

0...0

.

One possibility is the Householder reflector

H = In − 2uu∗

whereu = (v − ‖v‖2e(1))/‖v − ‖v‖2e(1)‖2.

H reflects about the subspace S⊥ where S = span{u}.

Emre Mengi Week 6, Lecture 2

Page 17: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

Example: Letting v =

[43

],

u =

([43

]−[

50

])/

∥∥∥∥[ 43

]−[

50

]∥∥∥∥ =1√10

[−1

3

],

H =

[1 00 1

]− 2

10

[−1

3

] [−1 3

]=

[4/5 3/53/5 −4/5

]

Emre Mengi Week 6, Lecture 2

Page 18: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

Example: Letting v =

[43

],

u =

([43

]−[

50

])/

∥∥∥∥[ 43

]−[

50

]∥∥∥∥ =1√10

[−1

3

],

H =

[1 00 1

]− 2

10

[−1

3

] [−1 3

]=

[4/5 3/53/5 −4/5

]

Emre Mengi Week 6, Lecture 2

Page 19: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

Householder Reflectors

Example: Letting v =

[43

],

u =

([43

]−[

50

])/

∥∥∥∥[ 43

]−[

50

]∥∥∥∥ =1√10

[−1

3

],

H =

[1 00 1

]− 2

10

[−1

3

] [−1 3

]=

[4/5 3/53/5 −4/5

]

Emre Mengi Week 6, Lecture 2

Page 20: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

1st Column

A =

x x . . . xx x xx x x...

......

x x x

7→

x x . . . x0 x x0 x x...

......

0 x x

= Q(1)A

Q(1) = I − 2u(1)[u(1)]∗

u(1) = (a(1) − ‖a(1)‖2e(1))/‖a(1) − ‖a(1)‖2e(1)‖2

Emre Mengi Week 6, Lecture 2

Page 21: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

1st Column

A =

x x . . . xx x xx x x...

......

x x x

7→

x x . . . x0 x x0 x x...

......

0 x x

= Q(1)A

Q(1) = I − 2u(1)[u(1)]∗

u(1) = (a(1) − ‖a(1)‖2e(1))/‖a(1) − ‖a(1)‖2e(1)‖2

Emre Mengi Week 6, Lecture 2

Page 22: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

2nd Column

A(2) := Q(1)A =

x x . . . x0 x x0 x x...

......

0 x x

7→

x x . . . x0 x x0 0 x...

......

0 0 x

= Q(2)Q(1)A

Q(2) =

[1 00 I − 2u(2)[u(2)]∗

]u(2) = (h(2) − ‖h(2)‖2e(1))/‖h(2) − ‖h(2)‖2e(1)‖2h(2) = A(2)(2 : n,2)

Emre Mengi Week 6, Lecture 2

Page 23: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

2nd Column

A(2) := Q(1)A =

x x . . . x0 x x0 x x...

......

0 x x

7→

x x . . . x0 x x0 0 x...

......

0 0 x

= Q(2)Q(1)A

Q(2) =

[1 00 I − 2u(2)[u(2)]∗

]u(2) = (h(2) − ‖h(2)‖2e(1))/‖h(2) − ‖h(2)‖2e(1)‖2h(2) = A(2)(2 : n,2)

Emre Mengi Week 6, Lecture 2

Page 24: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

kth column

A(k) =

[R(k) N(k)

0 M(k)

]7→[

R(k) N(k)

0 H(k)M(k)

]= Q(k)A(k)

where R(k) ∈ C(k−1)×(k−1) is upper triangular,M(k) ∈ C(n−k+1)×(n−k+1) is the block to be modified.

Q(k) =

[Ik−1 0

0 H(k) := I − 2u(k)[u(k)]∗

]u(k) = (h(k) − ‖h(k)‖2e(1))/‖h(k) − ‖h(k)‖2e(1)‖2h(k) = A(k)(k : n, k)

Emre Mengi Week 6, Lecture 2

Page 25: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

kth column

A(k) =

[R(k) N(k)

0 M(k)

]7→[

R(k) N(k)

0 H(k)M(k)

]= Q(k)A(k)

where R(k) ∈ C(k−1)×(k−1) is upper triangular,M(k) ∈ C(n−k+1)×(n−k+1) is the block to be modified.

Q(k) =

[Ik−1 0

0 H(k) := I − 2u(k)[u(k)]∗

]u(k) = (h(k) − ‖h(k)‖2e(1))/‖h(k) − ‖h(k)‖2e(1)‖2h(k) = A(k)(k : n, k)

Emre Mengi Week 6, Lecture 2

Page 26: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

After p steps, we have

Q(p) . . .Q(2)Q(1)A = R

where R ∈ Cn×p is upper triangular.

Emre Mengi Week 6, Lecture 2

Page 27: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

After p steps, we have

Q(p) . . .Q(2)Q(1)A = R

where R ∈ Cn×p is upper triangular.

This yields a full QR factorization

A =[Q(1)

]∗ [Q(2)

]∗. . .[Q(p)

]∗︸ ︷︷ ︸

Q

R.

Emre Mengi Week 6, Lecture 2

Page 28: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

After p steps, we have

Q(p) . . .Q(2)Q(1)A = R

where R ∈ Cn×p is upper triangular.

This yields a full QR factorization

A = Q(1)Q(2) . . .Q(p)︸ ︷︷ ︸Q

R.

Emre Mengi Week 6, Lecture 2

Page 29: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

Input: A ∈ Cn×p with n ≥ pOutput: Upper triangular R ∈ Cn×p and the vectors

u(1), . . . ,u(p).1: for k = 1,2, . . . ,p do2: v ← A(k : n, k)3: u(k) ←

(v − ‖v‖e(1)) /‖v − ‖v‖e(1)‖2

4: A(k : n, k : p)← A(k : n, k : p)− 2u(k)([u(k)

]∗A(k : n, k : p))

5: end for6: R ← A

Emre Mengi Week 6, Lecture 2

Page 30: Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math 504 Fall 2016 Notes Week 6, Lecture 2 Emre Mengi Department of Mathematics Koç

The Algorithm

Input: A ∈ Cn×p with n ≥ pOutput: Upper triangular R ∈ Cn×p and the vectors

u(1), . . . ,u(p).1: for k = 1,2, . . . ,p do2: v ← A(k : n, k)3: u(k) ←

(v − ‖v‖e(1)) /‖v − ‖v‖e(1)‖2

4: A(k : n, k : p)← A(k : n, k : p)− 2u(k)([u(k)

]∗A(k : n, k : p))

5: end for6: R ← A

Emre Mengi Week 6, Lecture 2