AMS526: Numerical Analysis I (Numerical Linear Algebra)

Similar documents
Lecture 7. Floating point arithmetic and stability

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Outline. Math Numerical Analysis. Errors. Lecture Notes Linear Algebra: Part B. Joseph M. Mahaffy,

AMS526: Numerical Analysis I (Numerical Linear Algebra)

AMS526: Numerical Analysis I (Numerical Linear Algebra)

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Notes on Conditioning

Lecture 9. Errors in solving Linear Systems. J. Chaudhry (Zeb) Department of Mathematics and Statistics University of New Mexico

EECS 275 Matrix Computation

AMS526: Numerical Analysis I (Numerical Linear Algebra)

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Numerical Linear Algebra

1 Error analysis for linear systems

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Lecture Notes 7, Math/Comp 128, Math 250

Numerical Linear Algebra Notes

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Scientific Computing: Dense Linear Systems

ERROR AND SENSITIVTY ANALYSIS FOR SYSTEMS OF LINEAR EQUATIONS. Perturbation analysis for linear systems (Ax = b)

AMS526: Numerical Analysis I (Numerical Linear Algebra)

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

Numerical Algorithms. IE 496 Lecture 20

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

AMS526: Numerical Analysis I (Numerical Linear Algebra) Lecture 23: GMRES and Other Krylov Subspace Methods; Preconditioning

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

ECS 231 Computer Arithmetic 1 / 27

Numerical Linear Algebra Primer. Ryan Tibshirani Convex Optimization /36-725

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Lecture 7. Gaussian Elimination with Pivoting. David Semeraro. University of Illinois at Urbana-Champaign. February 11, 2014

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Lecture 9: Numerical Linear Algebra Primer (February 11st)

The answer in each case is the error in evaluating the taylor series for ln(1 x) for x = which is 6.9.

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

ACM 106a: Lecture 1 Agenda

Lecture # 3 Orthogonal Matrices and Matrix Norms. We repeat the definition an orthogonal set and orthornormal set.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 9

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 3: Wednesday, Jan 9

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

Least-Squares Systems and The QR factorization

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

Scientific Computing

AMS527: Numerical Analysis II

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Introduction to Kleene Algebras

Lecture 5. Ch. 5, Norms for vectors and matrices. Norms for vectors and matrices Why?

MATH 3511 Lecture 1. Solving Linear Systems 1

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

Numerical Linear Algebra Primer. Ryan Tibshirani Convex Optimization

AMS526: Numerical Analysis I (Numerical Linear Algebra)

MIDTERM. b) [2 points] Compute the LU Decomposition A = LU or explain why one does not exist.

Introduction to Numerical Analysis

A Review of Matrix Analysis

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

AMS526: Numerical Analysis I (Numerical Linear Algebra)

WHEN MODIFIED GRAM-SCHMIDT GENERATES A WELL-CONDITIONED SET OF VECTORS

Chapter 2 - Linear Equations

1 Backward and Forward Error

Linear Algebra Massoud Malek

Validation for scientific computations Error analysis

MATH 612 Computational methods for equation solving and function minimization Week # 6

5 Solving Systems of Linear Equations

Basic Concepts in Linear Algebra

Review Questions REVIEW QUESTIONS 71

Lecture 4: Linear Algebra 1

Ack: 1. LD Garcia, MTH 199, Sam Houston State University 2. Linear Algebra and Its Applications - Gilbert Strang

Review of Basic Concepts in Linear Algebra

Numerical Linear Algebra

Scientific Computing: Solving Linear Systems

6.241 Dynamic Systems and Control

Conditioning and Stability

Gaussian Elimination for Linear Systems

Accurate and Efficient Matrix Computations with Totally Positive Generalized Vandermonde Matrices Using Schur Functions

Structured Condition Numbers and Backward Errors in Scalar Product Spaces

Linear algebra review

Exercise List: Proving convergence of the Gradient Descent Method on the Ridge Regression Problem.

Dense LU factorization and its error analysis

Notes on floating point number, numerical computations and pitfalls

Errors. Intensive Computation. Annalisa Massini 2017/2018

Iterative solvers for linear equations

Iterative solvers for linear equations

Lecture notes to the course. Numerical Methods I. Clemens Kirisits

Since the determinant of a diagonal matrix is the product of its diagonal elements it is trivial to see that det(a) = α 2. = max. A 1 x.

1. Introduction to commutative rings and fields

Computational Methods. Systems of Linear Equations

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

Section 12.4 Algebra of Matrices

Bindel, Spring 2017 Numerical Analysis (CS 4220) Notes for

7.6 The Inverse of a Square Matrix

NUMERICAL LINEAR ALGEBRA. Lecture notes for MA 660A/B. Rudi Weikard

Solving Linear Systems of Equations

2 = = 0 Thus, the number which is largest in magnitude is equal to the number which is smallest in magnitude.

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

1. Introduction to commutative rings and fields

Computational math: Assignment 1

Lecture 7. Econ August 18

Transcription:

AMS526: Numerical Analysis I (Numerical Linear Algebra) Lecture 09: Accuracy and Stability Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao Numerical Analysis I 1 / 12

Outline 1 Condition Number of Matrices 2 Accuracy and Stability 3 Stability of Algorithms Xiangmin Jiao Numerical Analysis I 2 / 12

Condition Number of Matrix-Vector Product Consider f (x) = Ax, with A C m n κ = J f (x) / x = A x Ax If A is square and nonsingular, since x / Ax A 1 κ A A 1 Question: For what x is equality achieved if 2-norm is used? Xiangmin Jiao Numerical Analysis I 3 / 12

Condition Number of Matrix-Vector Product Consider f (x) = Ax, with A C m n κ = J f (x) / x = A x Ax If A is square and nonsingular, since x / Ax A 1 κ A A 1 Question: For what x is equality achieved if 2-norm is used? Answer: x is equal to right singular vector corresponding to smallest singular value of A Question: What is condition number of Ax if A is singular? Answer: (is if x null(a)). What is the condition number for f (b) = A 1 b? Xiangmin Jiao Numerical Analysis I 3 / 12

Condition Number of Matrix-Vector Product Consider f (x) = Ax, with A C m n κ = J f (x) / x = A x Ax If A is square and nonsingular, since x / Ax A 1 κ A A 1 Question: For what x is equality achieved if 2-norm is used? Answer: x is equal to right singular vector corresponding to smallest singular value of A Question: What is condition number of Ax if A is singular? Answer: (is if x null(a)). What is the condition number for f (b) = A 1 b? Answer: κ A A 1 Xiangmin Jiao Numerical Analysis I 3 / 12

Condition Number of Matrix We define condition number of matrix A as κ(a) = A A 1 It is the upper bound of the condition number of f (x) = Ax for any x Another way to interpret at κ(a) is κ(a) = sup δx,x δf / δx f (x) / x = sup δx Aδx / δx infx Ax / x For 2-norm, κ(a) = σ 1 /σ n Note about the distinction between the condition number of a problem (the map f (x)) and the condition number of a problem instance (the evaluation of f (x) for specific x) Note: condition number of a problem is a property of a problem, and is independent of its algorithm Xiangmin Jiao Numerical Analysis I 4 / 12

Outline 1 Condition Number of Matrices 2 Accuracy and Stability 3 Stability of Algorithms Xiangmin Jiao Numerical Analysis I 5 / 12

Accuracy Roughly speaking, accuracy means that error is small in an asymptotic sense, say O(ɛ machine ) Notation ϕ(t) = O(ψ(t)) means C s.t. ϕ(t) C ψ(t) as t approaches 0 (or ) Example: sin 2 t = O(t 2 ) as t 0 If ϕ depends on s and t, then ϕ(s, t) = O(ψ(t)) means C s.t. ϕ(s, t) C ψ(t) for any s as t approaches 0 (or ) Example: sin 2 t sin 2 s = O(t 2 ) as t 0 When we say O(ɛ machine ), we are thinking of a series of idealized machines for which ɛ machine can be arbitrarily small Xiangmin Jiao Numerical Analysis I 6 / 12

More on Accuracy An algorithm f is accurate if relative error is in the order of machine precision, i.e., f (x) f (x) / f (x) = O(ɛ machine ), i.e., C 1 ɛ machine as ɛ machine 0, where constant C 1 may depend on the condition number and the algorithm itself In most cases, we expect f (x) f (x) / f (x) = O(κɛ machine ), i.e., Cκɛ machine as ɛ machine 0, where constant C should be independent of κ and value of x (although it may depends on the dimension of x) How do we determine whether an algorithm is accurate or not? It turns out to be an extremely subtle question A forward error analysis (operation by operation) is often too difficult and impractical, and cannot capture dependence on condition number An effective solution is backward error analysis Xiangmin Jiao Numerical Analysis I 7 / 12

Outline 1 Condition Number of Matrices 2 Accuracy and Stability 3 Stability of Algorithms Xiangmin Jiao Numerical Analysis I 8 / 12

Stability We say an algorithm is stable if it gives nearly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) f ( x) / f ( x) = O(ɛ machine ) for some x with x x / x = O(ɛ machine ) Xiangmin Jiao Numerical Analysis I 9 / 12

Stability We say an algorithm is stable if it gives nearly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) f ( x) / f ( x) = O(ɛ machine ) for some x with x x / x = O(ɛ machine ) We say an algorithm is backward stable if it gives exactly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) = f ( x) for some x with x x / x = O(ɛ machine ) Xiangmin Jiao Numerical Analysis I 9 / 12

Stability We say an algorithm is stable if it gives nearly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) f ( x) / f ( x) = O(ɛ machine ) for some x with x x / x = O(ɛ machine ) We say an algorithm is backward stable if it gives exactly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) = f ( x) for some x with x x / x = O(ɛ machine ) Is stability or backward stability stronger? Xiangmin Jiao Numerical Analysis I 9 / 12

Stability We say an algorithm is stable if it gives nearly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) f ( x) / f ( x) = O(ɛ machine ) for some x with x x / x = O(ɛ machine ) We say an algorithm is backward stable if it gives exactly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) = f ( x) for some x with x x / x = O(ɛ machine ) Is stability or backward stability stronger? Backward stability is stronger. Does (backward ) stability depend on condition number of f (x)? Xiangmin Jiao Numerical Analysis I 9 / 12

Stability We say an algorithm is stable if it gives nearly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) f ( x) / f ( x) = O(ɛ machine ) for some x with x x / x = O(ɛ machine ) We say an algorithm is backward stable if it gives exactly the right answer to nearly the right question More formally, an algorithm f for problem f is stable if (for all x) f (x) = f ( x) for some x with x x / x = O(ɛ machine ) Is stability or backward stability stronger? Backward stability is stronger. Does (backward ) stability depend on condition number of f (x)? No. Xiangmin Jiao Numerical Analysis I 9 / 12

Stability of Floating Point Arithmetic Backward stability of floating point operations is implied by these two floating point axioms: 1 x R, ɛ, ɛ ɛ machine s.t. fl(x) = x(1 + ɛ) 2 For floating-point numbers x, y, ɛ, ɛ ɛ machine s.t. x y = (x y)(1 + ɛ) Example: Subtraction f (x 1, x 2 ) = x 1 x 2 with floating-point operation f (x 1, x 2 ) = fl(x 1 ) fl(x 2 ) Axiom 1 implies fl(x1 ) = x 1 (1 + ɛ 1 ), fl(x 2 ) = x 2 (1 + ɛ 2 ), for some ɛ 1, ɛ 2 ɛ machine Axiom 2 implies fl(x 1 ) fl(x 2 ) = (fl(x 1 ) fl(x 2 ))(1 + ɛ 3 ) for some ɛ 3 ɛ machine Therefore, fl(x 1 ) fl(x 2 ) = (x 1 (1 + ɛ 1 ) x 2 (1 + ɛ 2 ))(1 + ɛ 3 ) = x 1 (1 + ɛ 1 )(1 + ɛ 3 ) x 2 (1 + ɛ 2 )(1 + ɛ 3 ) = x 1 (1 + ɛ 4 ) x 2 (1 + ɛ 5 ) where ɛ 4, ɛ 5 2ɛ machine + O(ɛ 2 machine ) Xiangmin Jiao Numerical Analysis I 10 / 12

Stability of Floating Point Arithmetic Cont d Example: Inner product f (x, y) = x y using floating-point operations and is backward stable Example: Outer product f (x, y) = xy using and is not backward stable Example: f (x) = x + 1 computed as f (x) = fl(x) 1 is not backward stable Example: f (x, y) = x + y computed as f (x, y) = fl(x) fl(y) is backward stable Xiangmin Jiao Numerical Analysis I 11 / 12

Accuracy of Backward Stable Algorithm Theorem If a backward stable algorithm f is used to solve a problem f with condition number κ using floating-point numbers satisfying the two axioms, then f (x) f (x) / f (x) = O(κ(x)ɛ machine ) Xiangmin Jiao Numerical Analysis I 12 / 12

Accuracy of Backward Stable Algorithm Theorem If a backward stable algorithm f is used to solve a problem f with condition number κ using floating-point numbers satisfying the two axioms, then f (x) f (x) / f (x) = O(κ(x)ɛ machine ) Proof: Backward stability means f (x) = f ( x) for x such that x x / x = O(ɛ machine ) Definition of condition number gives f ( x) f (x) / f (x) (κ(x) + o(1)) x x / x where o(1) 0 as ɛ machine 0. Combining the two gives desired result. Xiangmin Jiao Numerical Analysis I 12 / 12