Jim Lambers MAT 610 Summer Session 2009-10 Lecture 5 Notes These notes correspond to Sections 3.3 and 3.4 in the text. Roundoο¬ Analysis of Gaussian Elimination In this section, we will perform a detailed error analysis of Gaussian elimination, illustrating the analysis originally carried out by J. H. Wilkinson. The process of solving π΄x = b consists of three stages: ¯π ¯. 1. Factoring π΄ = πΏπ , resulting in an approximate πΏπ decomposition π΄ + πΈ = πΏ 2. Solving πΏy = b, or, numerically, computing y such that ¯ + πΏ πΏ)(y ¯ (πΏ + πΏy) = b 3. Solving π x = y, or, numerically, computing x such that ¯ + πΏπ ¯ )(x + πΏx) = y + πΏy. (π Combining these stages, we see that ¯ + πΏ πΏ)( ¯ π ¯ + πΏπ ¯ )(x + πΏx) b = (πΏ ¯π ¯ + πΏπΏ ¯π ¯ + πΏπΏ ¯ π ¯ + πΏ πΏπΏ ¯ π ¯ )(x + πΏx) = (πΏ ¯π ¯ + πΏπΏ ¯ π ¯ + πΏ πΏπΏ ¯ π ¯ )(x + πΏx) = (π΄ + πΈ + πΏ πΏ = (π΄ + πΏπ΄)(x + πΏx) ¯π ¯ + πΏπΏ ¯ π ¯ + πΏ πΏπΏ ¯ π ¯. where πΏπ΄ = πΈ + πΏ πΏ In this analysis, we will view the computed solution xΜ = x + πΏx as the exact solution to the perturbed problem (π΄ + πΏπ΄)x = b. This perspective is the idea behind backward error analysis, which we will use to determine the size of the perturbation πΏπ΄, and, eventually, arrive at a bound for the error in the computed solution xΜ. Error in the πΏπ Factorization Let π΄(π) denote the matrix π΄ after π β 1 steps of Gaussian elimination have been performed, where a step denotes the process of making all elements below the diagonal within a particular column 1 equal to zero. Then, in exact arithmetic, the elements of π΄(π+1) are given by (π) (π+1) πππ = (π) πππ β (π) πππ πππ , πππ = πππ (π) . (1) πππ Let π΅ (π) denote the matrix π΄ after π β 1 steps of Gaussian elimination have been performed using ο¬oating-point arithmetic. Then the elements of π΅ (π+1) are ( (π) ) πππ (π+1) (π) (π) (π+1) πππ = πππ β π ππ πππ + πππ , π ππ = π π . (2) (π) πππ For π β₯ π, we have (2) = πππ β π π1 π1π + πππ (3) = πππ β π π2 π2π + πππ .. . (π) = πππ πππ πππ πππ (1) (1) (2) (2) (2) (3) (πβ1) (πβ1) (π) β π π,πβ1 ππβ1,π + πππ Combining these equations yields π β (π) πππ = π=2 πβ1 β (π) πππ β π=1 πβ1 β (π) π ππ πππ + π=1 π β (π) πππ π=2 Cancelling terms, we obtain (1) (π) πππ = πππ + πβ1 β (π) π ππ πππ β πππ , π β₯ π, (3) π=1 (π) π=2 πππ . βπ where πππ = For π > π, (2) = πππ β π π1 π1π + πππ .. . (π) = πππ πππ πππ (π) (π) (π) (1) (πβ1) (1) (2) (πβ1) (π) β π π,πβ1 ππβ1,π + πππ (π) where π ππ = π π(πππ /πππ ) = πππ /πππ (1 + πππ ), and therefore (π) (π) (π) (π) (π) (π+1) 0 = πππ β π ππ πππ + πππ πππ = πππ β π ππ πππ + πππ (1) = πππ β π β π=1 2 (π) π ππ πππ + πππ (4) From (3) and (4), we obtain β‘ β’ β’ ¯ ¯ πΏπ = β’ β£ 1 π 21 .. . π π1 β€ β‘ (1) (1) (1) π11 π12 β β β π1π .. .. β₯β’ 1 . . β₯β’ β’ β₯β’ .. .. . β¦ .. . β£ . (π) β β β β β β 1 πππ where β€ β₯ β₯ β₯ = π΄ + πΈ. β₯ β¦ (π) π ππ = (π) (π) π π(πππ /πππ ) = πππ (π) πππ β£πππ β£ β€ u (1 + πππ ), Then, (π) (π) (π) (π) β£πππ β£ β€ u π π(π ππ πππ ) = π ππ πππ (1 + πππ ), and so, (π+1) πππ (π) (π) (π) = π π(πππ β π ππ πππ (1 + πππ )) (π) (π) (π) (π) = (πππ β π ππ πππ (1 + πππ ))(1 + πππ ), (π) β£πππ β£ β€ u. After applying (2), and performing some manipulations, we obtain ( (π+1) πππ = (π+1) πππ (π) πππ 1+ We then have the following bound for the β‘ 0 β β β β’ 1 β β β β’ β’ 1 2 β’ β£πΈβ£ β€ (1 + β)πΊπu β’ β’ ... ... β’ β’ β£ 1 2 ) (π) (π) (π) πππ β π ππ πππ πππ . entries of πΈ: β β β β β β β β β β β β β β β β β β β β β β β β β β β 0 1 2 β β β β β β 3 .. .. . β β β . β β β π β 1 π β 1 3 3 β€ β₯ β₯ β₯ β₯ β₯ + π(u2 ), β₯ β₯ β₯ β¦ where β = maxπ,π β£π ππ β£ and πΊ is the growth factor deο¬ned by (π) πΊ= maxπ,π,π β£¯πππ β£ maxπ,π β£πππ β£ . (π) The entries of the above matrix indicate how many of the πππ are included in each entry πππ of πΈ. 3 Bounding the perturbation in π΄ From a roundoο¬ analysis of forward and back substitution, which we do not reproduce here, we have the bounds ¯ ππ β£ β€ πuβ + π(u2 ), max β£πΏ πΏ π,π ¯ππ β£ β€ πuπΊπ + π(u2 ) max β£πΏ π π,π ¯ ππ β£, and πΊ is the growth factor. Putting our bounds together, where π = maxπ,π β£πππ β£, β = maxπ,π β£πΏ we have ¯ π ¯ππ β£ + max β£π ¯ πΏπΏ ¯ ππ β£ + max β£πΏ πΏπΏ ¯ π ¯ππ β£ max β£πΏπ΄ππ β£ β€ max β£πππ β£ + max β£πΏπΏ π,π π,π π,π π,π 2 2 π,π 2 β€ π(1 + β)πΊπu + π βπΊπu + π βπΊπu + π(u ) from which it follows that β₯πΏπ΄β₯β β€ π2 (2πβ + β + 1)πΊπu + π(u2 ). Bounding the error in the solution Let xΜ = x + πΏx be the computed solution. Since the exact solution to π΄x = b is given by x = π΄β1 b, we are also interested in examining xΜ = (π΄ + πΏπ΄)β1 b. Can we say something about β₯(π΄ + πΏπ΄)β1 b β π΄β1 bβ₯? We assume that β₯π΄β1 πΏπ΄β₯ = π < 1. We have π΄ + πΏπ΄ = π΄(πΌ + π΄β1 πΏπ΄) = π΄(πΌ β πΉ ), πΉ = βπ΄β1 πΏπ΄. From the manipulations (π΄ + πΏπ΄)β1 b β π΄β1 b = (πΌ + π΄β1 πΏπ΄)β1 π΄β1 b β π΄β1 b = (πΌ + π΄β1 πΏπ΄)β1 (π΄β1 β (πΌ + π΄β1 πΏπ΄)π΄β1 )b = (πΌ + π΄β1 πΏπ΄)β1 (βπ΄β1 (πΏπ΄)π΄β1 )b and this result from Lecture 2, β₯(πΌ β πΉ )β1 β₯ β€ 1 , 1βπ we obtain β₯πΏxβ₯ β₯xβ₯ = β₯(x + πΏx) β xβ₯ β₯xβ₯ 4 = β€ β€ β€ β₯(π΄ + πΏπ΄)β1 b β π΄β1 bβ₯ β₯π΄β1 bβ₯ 1 β₯π΄β1 β₯β₯πΏπ΄β₯ 1βπ 1 β₯πΏπ΄β₯ π (π΄) β1 1 β β₯π΄ πΏπ΄β₯ β₯π΄β₯ π (π΄) β₯πΏπ΄β₯ . β₯πΏπ΄β₯ β₯π΄β₯ 1 β π (π΄) β₯π΄β₯ Note that a similar conclusion is reached if we assume that the computed solution xΜ solves a nearby problem in which both π΄ and b are perturbed, rather than just π΄. We see that the important factors in the accuracy of the computed solution are β The growth factor πΊ β The size of the multipliers πππ , bounded by β β The condition number π (π΄) β The precision u In particular, π (π΄) must be large with respect to the accuracy in order to be troublesome. For example, consider the scenario where π (π΄) = 102 and u = 10β3 , as opposed to the case where π (π΄) = 102 and u = 10β50 . However, it is important to note that even if π΄ is well-conditioned, the error in the solution can still be very large, if πΊ and β are large. Pivoting During Gaussian elimination, it is necessary to interchange rows of the augmented matrix whenever the diagonal element of the column currently being processed, known as the pivot element, is equal to zero. However, if we examine the main step in Gaussian elimination, (π+1) πππ (π) (π) = πππ β πππ πππ , (π) we can see that any roundoο¬ error in the computation of πππ is ampliο¬ed by πππ . Because the multipliers can be arbitrarily small, it follows from the previous analysis that the error in the computed solution can be arbitrarily large. Therefore, Gaussian elimination is numerically unstable. Therefore, it is helpful if it can be ensured that the multipliers are small. This can be accomplished by performing row interchanges, or pivoting, even when it is not absolutely necessary to do so for elimination to proceed. 5 Partial Pivoting One approach is called partial pivoting. When eliminating elements in column π, we seek the largest element in column π, on or below the main diagonal, and then interchanging that elementβs row with row π. That is, we ο¬nd an integer π, π β€ π β€ π, such that β£πππ β£ = max β£πππ β£. πβ€πβ€π Then, we interchange rows π and π. (π) (π) In view of the deο¬nition of the multiplier, πππ = πππ /πππ , it follows that β£πππ β£ β€ 1 for π = 1, . . . , π β 1 and π = π + 1, . . . , π. Furthermore, while pivoting in this manner requires π(π2 ) comparisons to determine the appropriate row interchanges, that extra expense is negligible compared to the overall cost of Gaussian elimination, and therefore is outweighed by the potential reduction in roundoο¬ error. We note that when partial pivoting is used, the growth factor πΊ is 2πβ1 , where π΄ is π × π. Complete Pivoting While partial pivoting helps to control the propagation of roundoο¬ error, loss of signiο¬cant digits (π) can still result if, in the abovementioned main step of Gaussian elimination, πππ πππ is much larger (π) (π) in magnitude than πππ . Even though πππ is not large, this can still occur if πππ is particularly large. Complete pivoting entails ο¬nding integers π and π such that β£πππ β£ = max πβ€πβ€π,πβ€πβ€π β£πππ β£, and then using both row and column interchanges to move πππ into the pivot position in row π and column π. It has been proven that this is an eο¬ective strategy for ensuring that Gaussian elimination is backward stable, meaning it does not cause the entries of the matrix to grow exponentially as they are updated by elementary row operations, which is undesirable because it can cause undue ampliο¬cation of roundoο¬ error. The πΏπ Decomposition with Pivoting Suppose that pivoting is performed during Gaussian elimination. Then, if row π is interchanged with row π, for π > π, before entries in column π are eliminated, the matrix π΄(π) is eο¬ectively multiplied by a permutation matrix π (π) . A permutation matrix is a matrix obtained by permuting the rows (or columns) of the identity matrix πΌ. In π (π) , rows π and π of πΌ are interchanged, so that multiplying π΄(π) on the left by π (π) interchanges these rows of π΄(π) . It follows that the process of Gaussian elimination with pivoting can be described in terms of the matrix multiplications π (πβ1) π (πβ1) π (πβ2) π (πβ2) β β β π (1) π (1) π΄ = π, 6 where π (π) = πΌ if no interchange is performed before eliminating entries in column π. However, because each permutation matrix π (π) at most interchanges row π with row π, where π > π, there is no diο¬erence between applying all of the row interchanges βup frontβ, instead of applying π (π) immediately before applying π (π) for each π. It follows that [π (πβ1) π (πβ2) β β β π (1) ][π (πβ1) π (πβ2) β β β π (1) ]π΄ = π, and because a product of permutation matrices is a permutation matrix, we have π π΄ = πΏπ, where πΏ is deο¬ned as before, and π = π (πβ1) π (πβ2) β β β π (1) . This decomposition exists for any nonsingular matrix π΄. Once the πΏπ decomposition π π΄ = πΏπ has been computed, we can solve the system π΄x = b by ο¬rst noting that if x is the solution, then π π΄x = πΏπ x = π b. Therefore, we can obtain x by ο¬rst solving the system πΏy = π b, and then solving π x = y. Then, if b should change, then only these last two systems need to be solved in order to obtain the new solution; as in the case of Gaussian elimination without pivoting, the πΏπ decomposition does not need to be recomputed. Practical Computation of Determinants, Revisited When Gaussian elimination is used without pivoting to obtain the factorization π΄ = πΏπ , we have det(π΄) = det(π ), because det(πΏ) = 1 due to πΏ being unit lower-triangular. When pivoting is used, we have the factorization π π΄ = πΏπ , where π is a permutation matrix. Because a permutation matrix is orthogonal; that is, π π π = πΌ, and det(π΄) = det(π΄π ) for any square matrix, it follows that det(π )2 = 1, or det(π ) = ±1. Therefore, det(π΄) = ± det(π ), where the sign depends on the sign of det(π ). To determine this sign, we note that when two rows (or columns) of π΄ are interchanged, the sign of the determinant changes. Therefore, det(π ) = (β1)π , where π is the number of row interchanges that are performed during Gaussian elimination. The number π is known as the sign of the permutation represented by π that determines the ο¬nal ordering of the rows. We conclude that det(π΄) = (β1)π det(π ). 7
© Copyright 2026 Paperzz