Upcoming SlideShare
×

# Numerical Analysis 2. Condition and Stability

754 views
540 views

Published on

Slides based on "Inleiding tot de numerieke wiskunde" by Prof. Dr. Adhemar Bultheel and course notes by Prof. Dr. Marc Van Barel.

Published in: Technology
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

Views
Total views
754
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
21
0
Likes
1
Embeds 0
No embeds

No notes for slide
• Fault analysis: conditionand stability
• In fault analysis we want a good measure for the quality of the input data, and for the quality of the numerical method; therefore we introduce two new concepts: condition and stability.First we’ll talk about the description of a numerical problem, then we’ll define the condition of a numerical problem and finally we’ll look at the numerical stability of a method while making a distiction between forward stability, weak stability and backward stability.
• Description of a numerical problem.
• A relation F between data g and results r.F is an exact mathematical description of the relation, though note that different methods may apply to the same description. For example, you can define the relationship between two variables as a function, but there may be more than one method to find the corresponding value for one of the variables.
• The condition of a numerical problem.
• Definition:“the condition of a numerical problem indicates how much the result r is being influenced if the data g are altered”It is an exact relationship (F) between the altered data g* and the new result r*.Characteristic to a certain problemIndependent of the method
• The absolute error (capital delta g) on the data is the altered data g* subtracted by the data g.The relative error (lowercase delta g) on the data is the absolute error on the data divided by the norm of the data.The result r is the exact result of a relation F on the data g. The result r* is the exact result of a relation F on the data g*.The absolute error (capital delta r) on the result is the result of the function F on the altered data g* subtracted by the result r.The relative error (lowercase delta g) on the data is the absolute error on the result divided by the norm of the result.As you can see these calculations are quite straightforward.
• As you can see on the figure, the condition is independent of the method F. In a well-conditioned problem the distance between r and r* is small, in an ill-conditionedthe distance between r and r* is large.
• Take a certain “e” and consider all possible variations on the absolute error on the data g, not larger than “e” with the absolute error on the corresponding result. As measure for the condition, we take the largest possible ratio between the absolute error on the result and the absolute error on the data; this is the absolute condition number k A. Similarly we can find the relative condition number k R.
• If F is a differentiable function, we can determine the condition numbers with the following formulae.
• An example of the condition of a numerical problem.
• We want to know how the function f is conditioned. We calculate the relative condition number with the given formula.
• What can we conclude?De denominator becomes very small and approaches zero for values {x1 = –1; x2 = 3/2}; for these values the function is ill-conditioned, as the relative error becomes very large.
• Numerical stability of a numerical method.
• Implementing an exact relation F is usually not feasable,because of discretization and rounding errors.The first is due to the fact that some methods require an infinite number of operations to find an exact result.The second is a result of the fact that we only store a limited amount of digits, whereas there are numbers that require an many more digits or even an infinite amount of digits to represent them accurately.“Numerical stability measures the deviation of F* (the approximation) from F (the exact result).”We can measure this deviation in different ways, using:Forward stabilityBackward stability
• The absolute and relative forward stability are given by these formulae:“r” is defined as the result of the exact function F on the exact data g.r* is the result of the approximation F* on the exact data g.
• As can be seen in this figure.Note that the results may be influenced by an ill-conditioned numerical problem.
• To avoid the problem of ill-conditioned data g, we’ll calculate a value S, which is the ratio of the difference between the exact result r = F(g) and the approximation r*=F*(g) and the difference between the exact result r = F(g) and the exact result of an altered data r*’=F(g*). Basically this comes down to the relative error divided by the condition.A method has a weak stability when the condition number and the relative error approach each other. If the condition is small, but the relative error is large, the method is unstable. This is visualized on the next slide.
• As can be seen on this figure. This way we can avoid the influence of the ill-conditioned data. Still there is another way of measuring the stability of a method: backward stability.
• The idea is the following:Consider the result r* = F(g) to be the exact resultFind data g*’ corresponding to r*Measure the stability by comparing the norm of the difference between the data g, with the exact data corresponding to the approximated result r*, to s, as defined on the slide.
• A figure to visualize backward stability of a method.
• An example for evaluating the stability of a numerical method.
• We want to find out what the stability is for methods A and B for finding methods to evaluate a function “f”. The only difference between the methods is way in which the calculations are performed.We saw in our previous example that the function is ill-conditioned for the values -1 and -3/2
• We start with method A.First we want to determine the relative error on the result. To do this, we start by determining for each step in the algorithm an error “e i” less or equal to the machine precision “e mach”. This is the function f*, the approximation of f. f*(x) gives us y*, the value y with a deviation.If we solve the equation with the partial derivatives that approximate y*, we can use this result to calculate the relative error on the result.
• The denominator will approach zero for x going to 0 or -3/2,As we saw earlier the problem is well-conditioned for 0, so the method will be unstable for that value;On the other hand, the problem is also ill-conditioned for -3/2, so the method has a weak stability for that value.
• ### Numerical Analysis 2. Condition and Stability

1. 1. Numerical Analysis Fault analysis: condition and stability
2. 2. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
3. 3. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
4. 4. Description of a numerical problem • A relation F between data g and results r r = F(g) ▫ F is an exact mathematical description of the relation ▫ Different methods may apply to the same description
5. 5. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
6. 6. Condition • Definition: “the condition of a numerical problem indicates how much the result r is being influenced if the data g are altered” • Exact relationship • Characteristic to a certain problem • Independent of the method
7. 7. Condition • Definitions:
8. 8. Condition
9. 9. Condition • Condition number: ▫ Ratio of the error on the result and the error on the data ▫ Absolute condition kA and relative condition kR
10. 10. Condition • If F(g) is a differentiable function:
11. 11. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
12. 12. Condition : example • What is the condition of the evaluation of the function f : • Using the formula from the previous section:
13. 13. Condition : example • What can we conclude? ▫ De denominator approaches zero for values {x1 = –1; x2 = 3/2} ▫ For these values the function is ill-conditioned, as the relative error becomes very large.
14. 14. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
15. 15. Numerical stability • Implementing an exact relation F is usually not feasable: ▫ Discretization ▫ Rounding error F* • Definition: • “numerical stability measures the deviation of F* (the approximation) from F (the exact result).”
16. 16. Numerical stability : forward stability • Given by:
17. 17. Numerical stability : forward stability
18. 18. Numerical stability : weak stability
19. 19. Numerical stability : weak stability
20. 20. Numerical stability : backward stability • The idea is the following: ▫ Consider the result r* = F(g) to be the exact result ▫ Find data g*’ corresponding to r* ▫ Measure the stability with the following:
21. 21. Numerical stability : backward stability
22. 22. Overview • • • • • • • • Description of a numerical problem Condition Condition : example Numerical stability Numerical stability : forward stability Numerical stability : weak stability Numerical stability : backward stability Numerical stability : example
23. 23. Numerical stability : example • Investigate the stability of algorithms A and B for the function f:
24. 24. Numerical stability : example
25. 25. Numerical stability : example • Resulting formula: for x1 = 0, the relative error is large, and the condition is small: Unstable but for -3/2 the problem is also ill-conditioned Stability is weak
26. 26. Numerical stability : example • Can you evaluate algorithm B?
27. 27. Sources • “Inleiding tot de numerieke wiskunde”, A. Bultheel, 2007, Acco • http://en.wikipedia.org/wiki/Numerical_analysis • http://en.wikipedia.org/wiki/Condition_number By knowledgedriver, 2012.