From: kovarik@mcmail.cis.McMaster.CA (Zdislav V. Kovarik) Subject: Re: accuracy of computed matrix inverse Date: 7 Nov 2000 00:45:46 -0500 Newsgroups: sci.math.num-analysis Summary: [missing] In article , John Prussing wrote: :One way to test the accuracy of a computed matrix inverse is :obviously to multiply the computed inverse by the original matrix :and see how close the product is to the identity matrix. : :1) Is this the best way? : I am not qualified to pass judgment on that. I do have a (conditional) formula estimating the distance from A^(-1) to a guess X. Pick any matrix norm, denote q the smaller of ||I - A*X|| and ||I - X*A||, and suppose q < 1. Then ||inv(A) - X || <= ||X - X*A*X|| / (1-q). The proof uses just algebraic identities and comparison with geometric series. Care must be exercised when A is ill-conditioned. Incidentally, X - X*A*X is the "correction" if one uses Hotelling's iteration : X_new = X + (X - X*A*X) which will converge quadratically if q<1 (but watch for ill-conditioning for loss of valid digits). Here is a contrived example when ||I-X*A|| is drastically different from ||I-A*X||: A = [ 500 911 ] [ 309 563 ] X = [ 563.563 -911.911 ] [ -309 500 ] We have I - X*A = [ -0.001 0 ] [ 0 0 ] I - A*X = [ -281.5 455.5 ] [ -173.967 281.499 ] so in the "maximum of absolute row sums" norm, ||I - X*A|| = 0.001 ||I - A*X|| = 737 >2) If some additional property exists, say the determinant is equal >to 1, can this be used to enhance the accuracy of the computed >inverse? Not to my knowledge. The accuracy circumstances should not change with scaling (especially by powers of the base, 10 or 2), which may change the determinant according to well-known rules. Perhaps some other properties can be observed and used, such as symmetry. Finally, users of numerical methods have been urged for some time to re-phrase problems so that inverse matrices are not used, unless they are very obvious and "safe" (such as inverses of unitary matrices...), or unless the entries of the inverse matrix are parts of the required final answer. It may be more accurate and faster to use the inverse linear mapping without representing it as a matrix multiplication (e.g. as a pair of forward and backward substitution routines after a triangular factorization). Hope it helps, ZVK(Slavek) >-- >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >John E. Prussing >Dept. of Aeronautical & Astronautical Engineering >University of Illinois at Urbana-Champaign >http://www.uiuc.edu/~prussing >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=