Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Like in root finding, you will often have some idea of where the optimum is. In similar fashion, we can iteratively improve our brackets until they are close enough.

In the bisection root finding algorithm, two points were sufficient since they identify a sign change. For minimization, we need to determine a minimum, so we need 3 points.

Given 3 points (x1,x2,x3)(x_1, x_2, x_3)

Choose a point x4x_4

Evaluate the function at x4x_4

If f(x4)<f(x2)f(x_4) < f(x_2), select ⟨x2,x4,x3⟩\langle x_2, x_4, x_3 \rangle.

If f(x4)>f(x2)f(x_4) > f(x_2), select ⟨x1,x2,x4⟩\langle x_1, x_2, x_4 \rangle.

Repeat until a tolerance is met

How do we choose x4x_4?

Golden Section Search

The Golden ratio

To make a robust method, we want both of these paths to result in the same reduction of the search interval, and ideally reuse the function evaluations. This self-similarity implies we want to maintain the ratio of subdivision:

In the triplet ⟨x1,x2,x4⟩\langle x_1, x_2, x_4 \rangle with f4af_{4a}, we want ca=ab\frac{c}{a}=\frac{a}{b}.

In the triplet ⟨x2,x4,x3⟩\langle x_2, x_4, x_3 \rangle with f4bf_{4b}, we want cb−c=ab\frac{c}{b-c}=\frac{a}{b}.

Using these two equations, we can eliminate cc and find,

(ba)2−ba=1\left(\frac{b}{a}\right)^2 - \frac{b}{a} = 1

and ignoring the negative root,

ba=φ=1+52=1.618033988…\frac{b}{a} = \varphi = \frac{1+\sqrt{5}}{2} = 1.618033988\dots

the Golden ratio!

Convergence rate

Each iteration of the Golden section method reduces the bracketed interval by a constant factor of φ−1≈0.618\varphi^{-1} \approx 0.618.

The Golden section method is guaranteed to converge, doing so reliably at a linear rate (k=1k=1 with rate constant φ−1≈0.618\varphi^{-1} \approx 0.618).

Let’s see this on the unimodal function f(x)=x4+10xf(x) = x^4 + 10x (where the true minimum is at x∗=−(10/4)1/3≈−1.3572x^* = -(10/4)^{1/3} \approx -1.3572):

Brent’s method

We’ve seen this concept before in root finding with bisection. Later we saw the value of using the function values to approximate the derivative and guess at the root. Since we had two points, we fit a line (which approximated the derivative) which is the Secant method.

Now we have 3 points so we can fit a parabola and find fmin⁡=f(xmin⁡)f_{\min} = f(x_{\min})!

Parabolic interpolation

Fitting a parabola through the three points (x1,f1)(x_1, f_1), (x2,f2)(x_2, f_2), and (x3,f3)(x_3, f_3) allows us to jump directly to the vertex of that parabola as our next estimate x4x_4:

x4=x2−12(x2−x1)2(f2−f3)−(x2−x3)2(f2−f1)(x2−x1)(f2−f3)−(x2−x3)(f2−f1)x_4 = x_2 - \frac{1}{2} \frac{(x_2-x_1)^2(f_2-f_3) - (x_2-x_3)^2(f_2-f_1)}{(x_2-x_1)(f_2-f_3) - (x_2-x_3)(f_2-f_1)}

(Note: For root finding, where we want xx where f(x)=0f(x)=0, Brent’s root-finding algorithm uses inverse quadratic interpolation to fit x(f)x(f). For minimization, where we want f′(x)=0f'(x)=0, Brent’s minimization method uses successive parabolic interpolation as written above!)

The convergence order of parabolic interpolation on smooth functions is superlinear (k≈1.325k \approx 1.325).

Combination with Golden section

Brent’s method combines the robustness of the Golden Section method with the acceleration of parabolic approximation (still without any derivative information!).

Candidate steps from parabolic interpolation and Golden section are generated and compared against various criteria for robustness and progression.

This decision tree makes the exact convergence behavior adaptive, achieving superlinear convergence (k≈1.325k \approx 1.325) for well-behaved functions while guaranteeing at least the linear convergence rate of Golden section search.

Example: Unimodal minimization

Minimize f(x)=x4+10xf(x) = x^4 + 10x using Brent’s method and compare the evaluation count and convergence curve against Golden section search:

Example: Non-differentiable function

Let’s try a non-differentiable function: f(x)=∣x∣f(x) = |x|:

Example: A more treacherous function

Minimize f(x)=∣sin⁡(x)∣+∣cos⁡(x)∣+0.1x2f(x) = |\sin(x)| + |\cos(x)| + 0.1 x^2