Steffensen's method
In
Steffensen's method has the drawback that it requires two function evaluations per step, whereas the secant method requires only one evaluation per step, so it is not necessarily most efficient in terms of
Steffensen's method can be derived as an adaptation of Aitken's delta-squared process applied to fixed-point iteration. Viewed in this way, Steffensen's method naturally generalizes to efficient fixed-point calculation in general Banach spaces, whenever fixed points are guaranteed to exist and fixed-point iteration is guaranteed to converge, although possibly slowly, by the Banach fixed-point theorem.
Simple description
The simplest form of the formula for Steffensen's method occurs when it is used to find a
Given an adequate starting value a sequence of values can be generated using the formula below. When it works, each value in the sequence is much closer to the solution than the prior value. The value from the current step generates the value for the next step, via the formula[1]
for where the slope function is a composite of the original function given by the formula
or perhaps more clearly,
where is a step-size between the last iteration point, and an auxiliary point located at
Technically, the function is called the first-order
Because the value of is an approximation for its value can optionally be checked to see if it meets the condition which is required to guarantee convergence of Steffensen's algorithm. Although slight non-conformance may not necessarily be dire, any large departure from the condition warns that Steffensen's method is liable to fail, and temporary use of some fallback algorithm is warranted (e.g. the more robust
It is only for the purpose of finding for this auxiliary point that the value of the function must fulfill the requirement that [b] For all other parts of the calculation, Steffensen's method only requires the function to be continuous and to actually have a nearby solution.[1] Several modest modifications of the step used in the formula for the slope exist, such as multiplying it by 1 /2 or 3 /4, to accommodate functions that do not quite meet the requirement.
Advantages and drawbacks
The main advantage of Steffensen's method is that it has
The price for the quick convergence is the double function evaluation: Both and must be calculated, which might be time-consuming if is complicated. For comparison, both regula falsi and the secant method only need one function evaluation per step. The secant method increases the number of correct digits by "only" a factor of roughly 1.6 per step, but one can do twice as many steps of the secant method within a given time. Since the secant method can carry out twice as many steps in the same time as Steffensen's method,[d] in practical use the secant method actually converges faster than Steffensen's method, when both algorithms succeed: The secant method achieves a factor of about (1.6)2 ≈ 2.6 times as many digits for every two steps (two function evaluations), compared to Steffensen's factor of 2 for every one step (two function evaluations).
Similar to most other iterative root-finding algorithms, the crucial weakness in Steffensen's method is choosing a "sufficiently close" starting value If the value of is not "close enough" to the actual solution the method may fail, and the sequence of values may either erratically flip-flop between two (or more) extremes, or diverge to infinity, or both.
Derivation using Aitken's delta-squared process
The version of Steffensen's method implemented in the MATLAB code shown below can be found using Aitken's delta-squared process for convergence acceleration. To compare the following formulae to the formulae in the section above, notice that . This method assumes starting with a linearly convergent sequence and increases the rate of convergence of that sequence. If the signs of agree and is "sufficiently close" to the desired limit of the sequence , then we can assume
so that
Solving for the desired limit of the sequence gives:
which results in the more rapidly convergent sequence:
Code example
In Matlab
Here is the source for an implementation of Steffensen's Method in MATLAB.
function Steffensen(f, p0, tol) % This function takes as inputs: a fixed point iteration function, f, % and initial guess to the fixed point, p0, and a tolerance, tol. % The fixed point iteration function is assumed to be input as an % inline function. % This function will calculate and return the fixed point, p, % that makes the expression f(x) = p true to within the desired % tolerance, tol. format compact % This shortens the output. format long % This prints more decimal places. for i = 1:1000 % get ready to do a large, but finite, number of iterations. % This is so that if the method fails to converge, we won't % be stuck in an infinite loop. p1 = f(p0) + p0; % calculate the next two guesses for the fixed point. p2 = f(p1) + p1; p = p0-(p1-p0)^2/(p2-2*p1+p0) % use Aitken's delta squared method to % find a better approximation to p0. if abs(p - p0) < tol % test to see if we are within tolerance. break % if we are, stop the iterations, we have our answer. end p0 = p; % update p0 for the next iteration. end if abs(p - p0) > tol % If we fail to meet the tolerance, we output a % message of failure. 'failed to converge in 1000 iterations.' end
In Python
Here is the source for an implementation of Steffensen's method in Python.
from typing import Callable, Iterator Func = Callable[[float], float, float] def g(f: Func, x: float, fx: float) -> Func: """First-order divided difference function. Arguments: f: Function input to g x: Point at which to evaluate g fx: Function f evaluated at x """ return lambda x: f(x + fx) / fx - 1 def steff(f: Func, x: float, tol: float) -> Iterator[float]: """Steffenson algorithm for finding roots. This recursive generator yields the x_{n+1} value first then, when the generator iterates, it yields x_{n+2} from the next level of recursion. Arguments: f: Function whose root we are searching for x: Starting value upon first call, each level n that the function recurses x is x_n """ n = 0 while True: if n > 1000: print( "failed to converge in 1000 itterations" ) break else: n = n + 1 fx = f(x) if abs(fx) < tol: break else: gx = g(f, x, fx)(x) x = x - fx / gx # Update to x_{n+1} yield x # Yield value
Generalization to Banach space
Steffensen's method can also be used to find an input for a different kind of function that produces output the same as its input: for the special value Solutions like are called
Momentarily ignoring the issues of a more general
This method for finding fixed points of a real-valued function has been generalized for functions that map a Banach space onto itself or even more generally that map from one Banach space into another Banach space The generalized method assumes that a
1 |
The operator is roughly equivalent to a
If division is possible in the Banach space, then the linear operator can be obtained from
which may provide some insight: Expressed in this way, the linear operator can be more easily seen to be an elaborate version of the
Steffensen's method is then very similar to the Newton's method, except that it uses the divided difference instead of the derivative Note that for arguments close to some fixed point fixed point functions and their linear operators meeting condition (1), where is the identity operator.
In the case that division is possible in the Banach space, the generalized iteration formula is given by
for In the more general case in which division may not be possible, the iteration formula requires finding a solution close to for which
Equivalently, one may seek the solution to the somewhat reduced form
with all the values inside square brackets being independent of The bracketed terms all only depend on . However, the second form may not be as numerically stable as the first; because the first form involves finding a value for a (hopefully) small difference, it may be numerically more likely to avoid excessively large or erratic changes to the iterated value
If the linear operator satisfies
for some positive real constant then the method converges quadratically to a fixed point of if the initial approximation is "sufficiently close" to the desired solution that satisfies
Notes
- ^ For rare special case functions the derivative for Newton's method can be calculated at negligible cost, by using saved parts from evaluation of the main function. If optimized in this way, Newton's method becomes only slightly more costly per step than the secant method, and benefits from slightly faster convergence.
- ^ a b The condition ensures that if was used as a correction-function for for finding its own solution, it would step in the direction of the solution (), and that the new value would tend to lie in between the solution and the prior value (). But note that is only a self-correction function in principle. It is not actually used for that purpose, and it is not required to be efficient, even if it were so used.
- ^ The divided difference is either a forward-type or backward-type divided difference, depending on the sign of .
- ^ Because requires the prior calculation of the two evaluations must be done sequentially – the algorithm per se cannot be made faster by running the function evaluations in parallel. This is yet another disadvantage of Steffensen's method.
References
- ^ a b c Dahlquist, Germund; Björck, Åke (1974). Numerical Methods. Translated by Anderson, Ned. Englewood Cliffs, NJ: Prentice Hall. pp. 230–231.
- ^
Johnson, L.W.; Scholz, D.R. (June 1968). "On Steffensen's method". JSTOR 2949443.