21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Computation of Choleskyfactorization<br />

I + αww H = R H 1 R 1 .<br />

Motivation: “recursion” (2.9.8).<br />

➜ asymptotic complexity O(n 2 )<br />

(O(n), if only d,s computed<br />

→ (2.9.9))<br />

Code 2.9.6: Cholesky factorization of rank-1-modified identity<br />

matrix<br />

1 function [ d , s ] = r o i d ( alpha ,w)<br />

2 n = length (w) ;<br />

3 d = [ ] ; s = [ ] ;<br />

4 for i =1:n<br />

5 t = alpha∗w( i ) ;<br />

6 d = [ d ; sqrt (1+ t ∗w( i ) ) ] ;<br />

7 s = [ s ; t / d ( i ) ] ;<br />

8 alpha = alpha − s ( i ) ^2;<br />

9 end<br />

2.9.0.2 Adding a column<br />

Let us adopt an academic point of view: Before we have seen how to update a QR-factorization in<br />

the case of rank-1-modification of a square matrix.<br />

However, the QR-factorization makes sense for an arbitrary rectangular matrix. A possible modification<br />

of rectangular matrices is achieved by adding a row or a column. How can QR-factors updated<br />

efficiently for these kinds of modifications.<br />

An application of these modification techniques will be given in Chapter 6.<br />

3 Special structure of R 1 :<br />

⎛<br />

d 1 .<br />

R 1 = ⎜<br />

..<br />

⎝ ...<br />

⎞ ⎛<br />

s 1 ⎟<br />

⎠ + .<br />

⎜<br />

..<br />

⎝<br />

d n<br />

...<br />

⎛<br />

⎞<br />

⎞ 0 w 2 w 3 · · · · · · w n<br />

0 0 w 3 · · · · · · w n<br />

⎟<br />

. . .. .<br />

⎠<br />

⎜. 0 w n−1 w n<br />

⎟<br />

s n ⎝0 · · · · · · 0 w n ⎠<br />

0 · · · · · · 0<br />

(2.9.9)<br />

Ôº¾¾ ¾º<br />

Known:<br />

A ∈ K m,n ↦→ Ã = [ (A :,1 ,...,(A) :,k−1 ,v, (A) :,k ,...,(A) :,n<br />

]<br />

, v ∈ K m . (2.9.10)<br />

QR-factorization A = QR, Q ∈ K m,m unitary R ∈ K m,n upper triangular matrix.<br />

Ôº¾¾ ¾º<br />

Idea: Easy, if k = n + 1 (adding last column)<br />

Task: Efficient computation of QR-factorization à = ˜Q˜R of à from (2.9.10) , ˜Q ∈ K m,m unitary,<br />

˜R ∈ K m,n+1 upper triangular<br />

⎛<br />

⎞<br />

⎛ ⎞ ⎛ ⎞ 0 1 1 · · · · · · 1 ⎛ ⎞<br />

d 1 s 1 0 0 1 · · · · · · 1<br />

w 1 . .<br />

R 1 = ⎜ .<br />

⎟<br />

⎝ . .. ⎠ + .<br />

⎜<br />

..<br />

⎟<br />

. ... .<br />

. ⎜<br />

..<br />

⎟<br />

⎝ . .. ⎠<br />

⎜. 0 1 1<br />

⎝<br />

⎟<br />

... ⎠<br />

d n s n ⎝0 · · · · · · 0 1⎠<br />

w n<br />

0 · · · · · · 0<br />

Smart<br />

multiplication<br />

˜R := R 1 R<br />

Code 2.9.8: Update of Cholesky factorization in the case of s.p.d. preserving<br />

rank-1-modification<br />

1 function Rt = roudchol (R, alpha , v )<br />

2 w = R ’ \ v ;<br />

➜ Complexity O(n 2 3 [ d , s ] = r o i d ( alpha ,w) ;<br />

)<br />

4 T = zeros ( 1 , n ) ;<br />

5 for j =n−1:−1:1<br />

A + αvv H = ˜R H ˜R .<br />

6 T = [w( j +1)∗R( j + 1 , : ) +T ( 1 , : ) ; T ] ;<br />

7 end<br />

8 Rt = spdiags ( d , 0 , n , n ) ∗R+spdiags ( s , 0 , n , n ) ∗T ;<br />

MATLAB-function: R = cholupdate(R,v);<br />

Ôº¾¾ ¾º<br />

∃ column permutation<br />

k ↦→ n + 1 , i ↦→ i − 1 , i = k + 1, ...,n + 1<br />

∼ permutation matrix<br />

⎛<br />

⎞<br />

1 0 · · · · · · 0<br />

0 . ..<br />

1 0<br />

P =<br />

. 0 1<br />

∈ R n+1,n+1<br />

⎜.<br />

...<br />

⎟<br />

⎝<br />

1⎠<br />

0 · · · 1 0<br />

à −→<br />

1 If m > n + 1:<br />

A 1 = ÃP = [a·1,...,a·n ,v] = Q [ R Q H v ] = Q<br />

⎜<br />

column Q H v ⎝<br />

case m > n + 1<br />

∃ orthogonal transformation Q 1 ∈ K m,m (Householder reflection) with<br />

column k<br />

⎛<br />

R<br />

⎞<br />

⎟<br />

⎠<br />

Ôº¾¾ ¾º

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!