Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math...

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

Transcript of Math 504 Fall 2016 Notes Week 6, Lecture 2home.ku.edu.tr/.../Notes_files/slides_week6_2.pdf · Math...

Math 504 Fall 2016 NotesWeek 6, Lecture 2

Emre Mengi

Department of MathematicsKoç University

Istanbul, Turkey

Emre Mengi Week 6, Lecture 2

Outline

QR Factorization

QR Factorization by Householder Triangularization

Emre Mengi Week 6, Lecture 2

QR Factorization

Emre Mengi Week 6, Lecture 2

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

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

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

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

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

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

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

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

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

QR Factorization by HouseholderTriangularization

Emre Mengi Week 6, Lecture 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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