All Topics  
Numerical stability

 

   Email Print
   Bookmark   Link






 

Numerical stability



 
 
In the mathematical
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
 subfield of numerical analysis
Numerical analysis

Numerical analysis is the study of algorithms for the problems of continuous mathematics .One of the earliest mathematical writings is the Babylonian tablet YBC 7289, which gives a sexagesimal numerical approximation of , the length of the diagonal in a unit square....
, numerical stability is a desirable property of numerical algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
s. The precise definition of stability depends on the context, but it is related to the accuracy of the algorithm.

The relevant phenomenon is instability. Researchers are astonished when their calculations are swamped by errors even though they can prove they are doing perfect math. Typically their computations would work, in the limit, if there were no round-off or truncation errors, but depending on the specific computational method small errors can be magnified instead of damped leading to enormous errors and the phenomenon called "instability".

Sometimes a single calculation can be achieved in several ways, all of which are algebraically equivalent in terms of ideal real or complex numbers, but in practice when performed on digital computers yield different results.






Discussion
Ask a question about 'Numerical stability'
Start a new discussion about 'Numerical stability'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In the mathematical
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
 subfield of numerical analysis
Numerical analysis

Numerical analysis is the study of algorithms for the problems of continuous mathematics .One of the earliest mathematical writings is the Babylonian tablet YBC 7289, which gives a sexagesimal numerical approximation of , the length of the diagonal in a unit square....
, numerical stability is a desirable property of numerical algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
s. The precise definition of stability depends on the context, but it is related to the accuracy of the algorithm.

The relevant phenomenon is instability. Researchers are astonished when their calculations are swamped by errors even though they can prove they are doing perfect math. Typically their computations would work, in the limit, if there were no round-off or truncation errors, but depending on the specific computational method small errors can be magnified instead of damped leading to enormous errors and the phenomenon called "instability".

Sometimes a single calculation can be achieved in several ways, all of which are algebraically equivalent in terms of ideal real or complex numbers, but in practice when performed on digital computers yield different results. Some calculations might damp out approximation errors that occur; others might magnify such errors. Calculations that can be proven not to magnify approximation errors are called numerically stable. One of the common tasks of numerical analysis is to try to select algorithms which are robust — that is to say, have good numerical stability among other desirable properties.

Example


As an example of an unstable algorithm, consider the task of adding an array of 100 numbers. To simplify things, assume our computer only has two digits of precision (for example, you can only represent numbers in the hundreds as 100, 110, 120, etc.).

The obvious way to do this would be the following pseudo-code:

sum = 0 for i = 1 to 100 do sum = sum + a[i] end

That looks reasonable, but suppose the first element in the array was 1.0 and the other 99 elements were 0.01. In pure math, the answer would be 1.99. However, on our two-digit computer, once the 1.0 was added into the sum variable, adding in 0.01 would have no effect on the sum, and so the final answer would be 1.0 – not a very good approximation of the real answer.

A stable algorithm would first sort the array by the absolute values of the elements in ascending order. This ensures that the numbers closest to zero will be taken into consideration first. Once that change is made, all of the 0.01 elements will be added, giving 0.99, and then the 1.0 element will be added, yielding a rounded result of 2.0 – a much better approximation of the real result.

Forward, backward, and mixed stability


There are different ways to formalize the concept of stability. The following definitions of forward, backward, and mixed stability are often used in numerical linear algebra
Numerical linear algebra

Numerical linear algebra is the study of algorithms for performing linear algebra computations, most notably Matrix operations, on computers. It is often a fundamental part of engineering and computational science problems, such as and signal processing, computational finance, materials science simulations, structural biology, data mining,...
.

Forward and Backward Error
Consider the problem to be solved by the numerical algorithm as a function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 f mapping the data x to the solution y. The result of the algorithm, say y*, will usually deviate from the "true" solution y. The main causes of error are round-off error
Round-off error

A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value....
, truncation error
Truncation error

Truncation error or local truncation error is error made by numerical algorithms that arises from taking finite number of steps in computation....
 and data error. The forward error of the algorithm is the difference between the result and the solution; in this case, Δy = y* − y. The backward error is the smallest Δx such that f(x + Δx) = y*; in other words, the backward error tells us what problem the algorithm actually solved. The forward and backward error are related by the condition number
Condition number

In numerical analysis, the condition number associated with a problem is a measure of that problem's amenability to digital computation, that is, how numerically well-conditioned the problem is....
: the forward error is at most as big in magnitude as the condition number multiplied by the magnitude of the backward error.

In many cases, it is more natural to consider the relative error instead of the absolute error Δx.

The algorithm is said to be backward stable if the backward error is small for all inputs x. Of course, "small" is a relative term and its definition will depend on the context. Often, we want the error to be of the same order as, or perhaps only a few orders of magnitude bigger than, the unit round-off.

Mixed Stability Diagram
The usual definition of numerical stability uses a more general concept, called mixed stability, which combines the forward error and the backward error. An algorithm is stable in this sense if it solves a nearby problem approximately, i.e., if there exists a Δx such that both Δx is small and f(x + Δx) − y* is small. Hence, a backward stable algorithm is always stable.

An algorithm is forward stable if its forward error divided by the condition number of the problem is small. This means that an algorithm is forward stable if it has a forward error of magnitude similar to some backward stable algorithm.

Error Growth


Definition
Suppose that Ei > 0 denotes an initial error and En represents the magnitude of an error after n subsequent operations. If En ˜ C*n*Ei, where C is a constant independent of n, then the growth of the error is said to be linear. If En ˜ Cn*Ei, for some C > 1, then the growth of the error is called exponential.

Stability in numerical differential equations


The above definitions are particularly relevant in situations where truncation errors are not important. In other contexts, for instance when solving differential equation
Differential equation

A differential equation is a mathematics equation for an unknown function of one or several variable that relates the values of the function itself and its derivatives of various orders....
s, a different definition of numerical stability is used.

In numerical ordinary differential equations
Numerical ordinary differential equations

Numerical ordinary differential equations is the part of numerical analysis which studies the numerical solution of differential equation . This field is also known under the name numerical integration, but some people reserve this term for the computation of integrals....
, various concepts of numerical stability exist, for instance A-stability. They are related to some concept of stability in the dynamical systems sense, often Lyapunov stability
Lyapunov stability

In mathematics, the notion of Lyapunov stability occurs in the study of dynamical systems. In simple terms, if all solutions of the dynamical system that start out near an equilibrium point stay near forever, then is Lyapunov stable....
. It is important to use a stable method when solving a stiff equation
Stiff equation

In mathematics, a stiff equation is a differential equation for which certain numerical ordinary differential equations for solving the equation are numerical stability, unless the step size is taken to be extremely small....
.

Yet another definition is used in numerical partial differential equations
Numerical partial differential equations

Numerical partial differential equations is the branch of numerical analysis that studies the numerical solution of partial differential equations ....
. An algorithm for solving an evolutionary partial differential equation
Partial differential equation

In mathematics, partial differential equations are a type of differential equation, i.e., a Relation involving an unknown Function of several independent variables and its partial derivatives with respect to those variables....
 is stable if the numerical solution at a fixed time remains bounded as the step size goes to zero. The Lax equivalence theorem
Lax equivalence theorem

In numerical analysis, the Lax equivalence theorem is the fundamental theorem in the analysis of finite difference methods for the numerical solution of partial differential equations....
 states that an algorithm converges if it is consistent and stable (in this sense). Stability is sometimes achieved by including numerical diffusion
Numerical diffusion

Numerical diffusion is a difficulty with computer simulations of Continuous function systems such as fluids or Plasma ....
. Numerical diffusion is a mathematical term which ensures that roundoff and other errors in the calculation get spread out and do not add up to cause the calculation to "blow up". von Neumann stability analysis
Von Neumann stability analysis

In numerical analysis, von Neumann stability analysis is a procedure used to verify the Numerical stability of finite difference schemes as applied to linear partial differential equations....
 is a commonly used procedure for the stability analysis of finite difference schemes as applied to linear partial differential equations.

See also

  • Algorithms for calculating variance
    Algorithms for calculating variance

    Algorithms for calculating variance play a major role in statistics computing. A key problem in the design of good algorithms for this problem is that formulas for the variance may involve sums of squares, which can lead to numerical instability as well as to arithmetic overflow when dealing with large values....