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.

Example 2.5.5 (Instability of multiplication with inverse).<br />

Nearly singular matrix from Ex. 2.5.3<br />

Perturbed linear system:<br />

Ax = b ↔ (A + ∆A)˜x = b + ∆b (A + ∆A)(˜x − x) = ∆b − ∆Ax . (2.5.7)<br />

Code 2.5.7: instability of multiplication with inverse<br />

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

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

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

3<br />

4 r e s u l t = [ ] ;<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∗rand ( n , n ) ;<br />

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

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

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

10 B = inv (A) ; x i = B∗b ;<br />

11 r i = b − A∗ x i ; % residual<br />

12 R = eye ( n ) − A∗B; % residual<br />

13 r e s u l t = [ r e s u l t ; epsilon ,<br />

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

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

norm(R, ’ i n f ’ ) / norm(B, ’ i n f ’ ) ] ;<br />

14 end<br />

relative residual<br />

ε<br />

Gaussian elimination<br />

multiplication with inversel<br />

10 0<br />

inverse<br />

10 −2<br />

10 −4<br />

10 −6<br />

10 −8<br />

10 −10<br />

10 −12<br />

10 −14<br />

10 −16<br />

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

10 10 10 10 10 10 10 10 10 10 Fig. 56<br />

10 2<br />

Ôº½¾ ¾º<br />

✬<br />

Theorem 2.5.9 (Conditioning of LSEs).<br />

If A regular, ‖∆A‖ < ∥ ∥A −1∥ ∥ −1 and (2.5.7), then<br />

∥<br />

‖x − ˜x‖ ∥A −1∥ ∥<br />

(<br />

‖A‖ ‖∆b‖<br />

≤<br />

‖x‖ 1 − ∥ ∥A −1∥ ∥ ‖A‖ ‖∆A‖ / ‖A‖ ‖b‖ + ‖∆A‖ )<br />

.<br />

‖A‖<br />

✫<br />

relative error<br />

The proof is based on the following fundamental result:<br />

✬<br />

Lemma 2.5.10 (Perturbation lemma).<br />

✫<br />

B ∈ R n,n , ‖B‖ < 1 ⇒ I + B regular ∧<br />

relative perturbations<br />

∥<br />

∥(I + B) −1∥ ∥ ∥ ≤<br />

1<br />

1 − ‖B‖ .<br />

✩<br />

✪<br />

✩<br />

Ôº½¿½ ¾º<br />

✪<br />

Computation of the inverse B := inv(A) is affected by roundoff errors, but does not benefit from<br />

favorable compensation of roundoff errors as does Gaussian elimination.<br />

Proof. △-inequality ➣ ‖(I + B)x‖ ≥ (1 − ‖B‖) ‖x‖, ∀x ∈ R n ➣ I + B regular.<br />

∥<br />

∥(I + B) −1 x ∥ ∥<br />

∥(I + B) −1∥ ∥ =<br />

sup<br />

x∈R n \{0}<br />

‖x‖<br />

‖y‖<br />

= sup<br />

y∈R n \{0} ‖(I + B)y‖ ≤ 1<br />

1 − ‖B‖<br />

2.5.4 Conditioning<br />

✸<br />

Proof (of Thm. 2.5.9) Lemma 2.5.10<br />

⇒ ‖∆x‖ ≤<br />

➣<br />

∥<br />

∥(A + ∆A) −1∥ ∥ ∥ ≤<br />

∥ ∥ A −1∥ ∥<br />

1 − ∥ ∥A −1 ∆A ∥ & (2.5.7)<br />

∥<br />

∥A −1∥ ∥<br />

∥<br />

1 − ∥ ∥A −1 ∆A ∥ (‖∆b‖ + ‖∆Ax‖) ≤ A −1∥ ∥ ‖A‖<br />

1 − ∥ ∥A −1∥ ∥ ‖∆A‖<br />

( ‖∆b‖<br />

‖A‖ ‖x‖ + ‖∆A‖ )<br />

‖x‖ .<br />

‖A‖<br />

Considered:<br />

linear system of equatios Ax = b, A ∈ R n,n regular, b ∈ R<br />

̂x ∈ M n ˆ= computed solution (by Gaussian elimination with partial pivoting)<br />

Definition 2.5.11 (Condition (number) of a matrix).<br />

Condition (number) of a matrix A ∈ R n,n ∥<br />

: cond(A) := ∥A −1∥ ∥ ‖A‖<br />

Question:<br />

implications of stability results (→ previous section) for<br />

(normwise) relative error:<br />

(‖·‖ ˆ= suitable vector norm, e.g., maximum norm ‖·‖ ∞ )<br />

ǫ r :=<br />

‖x − ˜x‖<br />

‖x‖<br />

.<br />

Ôº½¿¼ ¾º<br />

Note: cond(A) depends on ‖·‖ !<br />

Ôº½¿¾ ¾º

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

Saved successfully!

Ooh no, something went wrong!