21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Observation: In practice ρ (almost) always grows only mildly (like O( √ n)) with n<br />

Discussion in [42, Lecture 22]: growth factors larger than the orderO( √ n) are exponentially rare in<br />

certain relevant classes of random matrices.<br />

Gaussian elimination/LU-factorization with partial pivoting is stable (∗)<br />

(for all practical purposes) !<br />

(∗): stability refers to maximum norm ‖·‖ ∞ .<br />

u = 3 1(1, 2, 3, ...,10)T ,<br />

9 r = b − A∗ x t ; % residual<br />

v = (−1, 2 1, −1 3 , 4 1,..., 10 1 10 r e s u l t = [ r e s u l t ; epsilon ,<br />

norm( x−xt , ’ i n f ’ ) / nx ,<br />

<strong>Numerical</strong> experiment with nearly singular<br />

Code 2.5.4: small residuals for GE<br />

1 n = 10; u = ( 1 : n ) ’ / 3 ; v =<br />

( 1 . / u ) .∗( −1) . ^ ( ( 1 : n ) ’ ) ;<br />

matrix<br />

2 x = ones ( 1 0 ,1) ; nx = norm( x , ’ i n f ’ ) ;<br />

A = uv T 3<br />

+ ǫI ,<br />

4 r e s u l t = [ ] ;<br />

singular rank-1 matrix<br />

5 for e p s i l o n = 10.^(−5:−0.5:−14)<br />

6 A = u∗v ’ + e p s i l o n∗eye ( n ) ;<br />

with<br />

7 b = A∗x ; nb = norm( b , ’ i n f ’ ) ;<br />

8 x t = A \ b ; % Gaussian elimination<br />

norm( r , ’ i n f ’ ) / nb ,<br />

cond (A, ’ i n f ’ ) ] ;<br />

11 end<br />

In practice Gaussian elimination/LU-factorization with partial pivoting<br />

produces “relatively small residuals”<br />

Ôº½¾ ¾º<br />

Ôº½¾ ¾º<br />

Definition 2.5.8 (Residual).<br />

Given an approximate solution ˜x ∈ K n of the LSE Ax = b (A ∈ K n,n , b ∈ K n ), its residual<br />

is the vector<br />

r = b − A˜x .<br />

10 2<br />

10 0<br />

10 −2<br />

10 −4<br />

10 −6<br />

10 −8<br />

ε<br />

relative error<br />

relative residual<br />

Observations (w.r.t ‖·‖ ∞ -norm)<br />

for ǫ ≪ 1 large relative error in computed solution<br />

˜x<br />

Simple consideration:<br />

10 −10<br />

10 −12<br />

small residuals for any ǫ<br />

(A + ∆A)˜x = b ⇒ r = b − A˜x = ∆A˜x ⇒ ‖r‖ ≤ ‖∆A‖ ‖˜x‖ ,<br />

10 −14<br />

for any vector norm ‖·‖.<br />

Example 2.5.3 (Small residuals by Gaussian elimination).<br />

Ôº½¾ ¾º<br />

10 −16<br />

10 −14 10 −13 10 −12 10 −11 10 −10 10 −9 10 −8 10 −7 10 −6 10 −5<br />

Fig. 34<br />

How can a large relative error be reconciled with a small relative residual ?<br />

Ax = b ↔ A˜x ≈ b<br />

{ ∥<br />

A(x − ˜x) = r ⇒ ‖x − ˜x‖ ≤ A −1∥ ∥ ‖r‖ ‖x − ˜x‖<br />

∥<br />

⇒ ≤ ‖A‖ ∥A −1∥ ∥ ‖r‖<br />

Ax = b ⇒ ‖b‖ ≤ ‖A‖ ‖x‖<br />

‖x‖<br />

‖b‖ . (2.5.6)<br />

➣ If ‖A‖ ∥ ∥A −1∥ ∥ ≫ 1, then a small relative residual may not imply a small relative error.<br />

Ôº½¾ ¾º<br />

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

Saved successfully!

Ooh no, something went wrong!