TExcelTAD
Home › Numerical Methods › Fixed-Point Iteration

Fixed-Point Iteration

Rewrite f(x)=0f(x) = 0 as x=g(x)x = g(x) and iterate xk+1=g(xk)x_{k+1} = g(x_k). If the iteration converges, its limit is a fixed point of gg, and hence a root of ff. Fixed-point iteration is the simplest iterative method, and its analysis explains when and how fast every other iteration converges.

Examples

x2−x−1=0x^2 - x - 1 = 0 can be written as x=1+1xx = 1 + \frac{1}{x}, as x=1+xx = \sqrt{1 + x}, or as x=x2−1x = x^2 - 1. All three have the golden ratio ϕ≈1.618\phi \approx 1.618 as a fixed point, but they behave differently:

python · try it yourself
import numpy as np

phi = (1 + np.sqrt(5)) / 2
forms = {"1 + 1/x": lambda x: 1 + 1 / x, "sqrt(1 + x)": lambda x: np.sqrt(1 + x), "x^2 - 1": lambda x: x * x - 1}
for name, g in forms.items():
    x = 1.5
    for _ in range(20):
        x = g(x)
    print(f"{name:12s}: x_20 = {x:.10f}, error {abs(x - phi):.1e}, |g'(phi)| = {abs((g(phi + 1e-7) - g(phi - 1e-7)) / 2e-7):.3f}")
1 + 1/x     : x_20 = 1.6180339882, error 5.4e-10, |g'(phi)| = 0.382
sqrt(1 + x) : x_20 = 1.6180339887, error 7.6e-12, |g'(phi)| = 0.309
x^2 - 1     : x_20 = -0.0000001054, error 1.6e+00, |g'(phi)| = 3.236

When does it converge?

If ∣g′(x)∣≤L<1\lvert g'(x)\rvert \le L < 1 near the fixed point pp, the iteration is a contraction there: by the mean value theorem,

∣xk+1−p∣=∣g(xk)−g(p)∣=∣g′(ξk)∣ ∣xk−p∣≤L∣xk−p∣.\lvert x_{k+1} - p\rvert = \lvert g(x_k) - g(p)\rvert = \lvert g'(\xi_k)\rvert\,\lvert x_k - p\rvert \le L\lvert x_k - p\rvert.

The error shrinks by about ∣g′(p)∣\lvert g'(p)\rvert per step: linear convergence with rate σ=∣g′(p)∣\sigma = \lvert g'(p)\rvert. If ∣g′(p)∣>1\lvert g'(p)\rvert > 1 the fixed point repels and the iteration cannot converge to it. In the example, 1+1x1 + \frac{1}{x} has rate 0.3820.382, 1+x\sqrt{1 + x} has rate 0.3090.309, and x2−1x^2 - 1 has ∣g′(ϕ)∣=2ϕ≈3.24\lvert g'(\phi)\rvert = 2\phi \approx 3.24, so the iteration is pushed away from ϕ\phi (here it ends up bouncing between 00 and −1-1, a 2-cycle of x2−1x^2 - 1).

Contraction mapping theorem. If gg maps an interval [a,b][a, b] into itself and ∣g′∣≤L<1\lvert g'\rvert \le L < 1 on it, then gg has exactly one fixed point there, and the iteration converges to it from any starting point in [a,b][a, b].

Faster when g′(p)=0g'(p) = 0

If g′(p)=0g'(p) = 0, Taylor expansion gives ϵk+1≈12g′′(p)ϵk2\epsilon_{k+1} \approx \frac{1}{2}g''(p)\epsilon_k^2: quadratic convergence. Newton's method is exactly the fixed-point iteration g(x)=x−f(x)f′(x)g(x) = x - \frac{f(x)}{f'(x)}, which has g′(r)=0g'(r) = 0 at a simple root (Newton's Method).

Estimating the rate from the iterates

python · try it yourself
import numpy as np

g = lambda x: np.cos(x)                # fixed point of cos: the Dottie number
x = [1.0]
for _ in range(40):
    x.append(g(x[-1]))
x = np.array(x)
p = x[-1]
err = np.abs(x[:20] - p)
print("error ratios:", np.round(err[1:8] / err[:7], 4))
print(f"|g'(p)| = |sin p| = {abs(np.sin(p)):.4f}, p = {p:.10f}")
error ratios: [0.7619 0.596  0.7158 0.6415 0.6934 0.6595 0.6827]
|g'(p)| = |sin p| = 0.6736, p = 0.7390851699

In software

  • Many algorithms are fixed-point iterations in disguise: PageRank (power iteration), the EM algorithm, value iteration in reinforcement learning, self-consistent field methods in chemistry. Their convergence rates are governed by the same contraction factor.
  • Aitken's Δ2\Delta^2 acceleration (and scipy.optimize.fixed_point, which uses Steffensen's method) can turn a linearly converging sequence into a much faster one.

Exercises

Exercise 1: Rate

What is the convergence rate of xk+1=12cos⁡xkx_{k+1} = \frac{1}{2}\cos x_k near its fixed point p≈0.4502p \approx 0.4502?

Answer

About 0.2180.218.

Solution

g′(x)=−12sin⁡xg'(x) = -\frac{1}{2}\sin x, so ∣g′(p)∣=12sin⁡0.4502≈0.2176\lvert g'(p)\rvert = \frac{1}{2}\sin 0.4502 \approx 0.2176.

Exercise 2: Which form converges?

For x3−x−1=0x^3 - x - 1 = 0 (root r≈1.3247r \approx 1.3247), does x=x3−1x = x^3 - 1 or x=(x+1)1/3x = (x + 1)^{1/3} converge?

Answer

x=(x+1)1/3x = (x + 1)^{1/3}.

Solution

ddx(x3−1)=3x2≈5.26\frac{d}{dx}(x^3 - 1) = 3x^2 \approx 5.26 at rr (repels); ddx(x+1)1/3=13(x+1)−2/3≈0.19\frac{d}{dx}(x + 1)^{1/3} = \frac{1}{3}(x + 1)^{-2/3} \approx 0.19 (attracts).

Exercise 3: Aitken acceleration (code)

Apply Aitken's formula x^k=xk−(xk+1−xk)2xk+2−2xk+1+xk\hat{x}_k = x_k - \frac{(x_{k+1} - x_k)^2}{x_{k+2} - 2x_{k+1} + x_k} to the iterates of xk+1=cos⁡xkx_{k+1} = \cos x_k and compare errors at k=10k = 10.

Answer

Aitken's value is about three orders of magnitude more accurate (4×10−64 \times 10^{-6} against 5×10−35 \times 10^{-3}).

Solution
python · try it yourself
import numpy as np
x = [1.0]
for _ in range(100):
    x.append(np.cos(x[-1]))
x = np.array(x); p = x[-1]
k = 10
aitken = x[k] - (x[k + 1] - x[k]) ** 2 / (x[k + 2] - 2 * x[k + 1] + x[k])
print(f"plain error {abs(x[k] - p):.1e}, Aitken error {abs(aitken - p):.1e}")
plain error 5.2e-03, Aitken error 4.0e-06

Test yourself

Fixed-point iteration xk+1=g(xk)x_{k+1} = g(x_k) converges locally when…

  1. ∣g′(p)∣<1\lvert g'(p)\rvert < 1
  2. g(p)=0g(p) = 0
  3. g′(p)>1g'(p) > 1
  4. gg is a polynomial

If ∣g′(p)∣=0.1\lvert g'(p)\rvert = 0.1, each iteration gains about…

  1. one decimal digit
  2. two digits
  3. doubles the digits
  4. nothing

Newton's method converges quadratically because, as a fixed-point iteration, …

  1. g′(r)=0g'(r) = 0
  2. g′(r)=1g'(r) = 1
  3. gg is linear
  4. ff is convex