Numerical Methods

All books

Optimisation

You have one of these when you can score any candidate answer with a single number, and you want the best one.

Optimisation, not eigenvalues. Here you can score every candidate and pick the best. An eigenvalue problem says which values are allowed at all.

What you are modelling

Nothing moves and nothing is at every point. You have a set of choices, and a rule that turns a choice into a cost, a profit, an error or a score. The model says which choices are allowed and how good each one is.

The model you write down

min⁡xf(x)subject tog(x)≤0,h(x)=0.\min_{x} f(x) \quad \text{subject to} \quad g(x) \le 0, \quad h(x) = 0 .

The function ff is what you want to be small. The constraints say which xx you are allowed to try. If there are no constraints, the model is one function and one region.

What it becomes on a computer

Worked number. For f(x)=(x−3)2f(x)=(x-3)^2, setting f′(x)=2(x−3)f'(x)=2(x-3) to zero gives x=3x=3, and one Newton step from x=0x=0 lands there.

A function that can be evaluated, and often differentiated. Each step asks "which way is downhill, and how far?" — so the cost of a solve is the number of evaluations multiplied by the cost of one evaluation. That second factor is why a model that takes a day to run changes the whole method.

The shape of ff is what decides the difficulty:

The step size is the whole difficulty of the simplest case. The figure runs gradient descent on a quadratic, where the condition is 0<step<2/a0 \lt \text{step} \lt 2/a; above it the iterates grow while the objective is still defined.

Figure 1

The signature

There is no propagation and no memory. The answer is a single point, and the difficulty is entirely in the shape of the landscape and in the constraints.

Flags that matter here

Techniques

Every method named here is in Methods, A to Z, with its price and what it will not do.

Start from the model you have. Each row is a property of the model in front of you, the methods that fit it, and what the fit costs. The method-keyed table below is the same list sorted by name.

what your model is the methods that fit the price
no constraints, and a derivative you can compute Gradient descent, Newton, quasi-Newton (BFGS) the step length is a separate decision
no constraints, and no derivative Nelder–Mead slow above a few dimensions
a sum of squares you are fitting Gauss–Newton the Jacobian is the cost
constraints that are linear or smooth Simplex method, interior point, sequential quadratic programming the constraint handling is the code
a function you can only sample, or one with noise Stochastic gradient, Adam, Bayesian optimisation many runs, and no guarantee
several local answers Multistart the cost multiplies by the number of starts
technique what it does when it wins when it is the wrong tool
Gradient descent Steps downhill along −∇f-\nabla f Very many unknowns, cheap gradient Narrow valleys; it zig-zags
Newton Uses the curvature as well as the slope Few unknowns, second derivatives available Each step costs a linear solve; needs a good start
Quasi-Newton (BFGS) Builds curvature from gradients it has seen Second derivatives unavailable Very large problems where the stored matrix is too big
Gauss–Newton, Levenberg–Marquardt Least squares, with damping Fitting a model to data Not a least-squares residual
Nelder–Mead Compares a simplex of points, no derivatives Noisy or non-smooth ff, few unknowns More than about ten unknowns; it stalls
Simplex method Walks the corners of a linear problem Linear objective, linear constraints Anything non-linear
Interior point Approaches the boundary from inside Large linear and convex problems Non-convex problems with many local minima
Sequential quadratic programming Solves a quadratic model at each step Smooth non-linear constraints Constraints that are noisy or discontinuous
Stochastic gradient, Adam Samples the objective Machine learning, huge data sets You need a precise optimum
Multistart Runs a local method from many starts Many local minima, cheap runs Expensive runs; better to use a surrogate
Bayesian optimisation Fits a surrogate and chooses where to look Very expensive evaluations Cheap evaluations; a grid would do

Systems that live here

What goes wrong

symptom cause fix
It converged, but to a worse answer than a colleague's A different local minimum Multistart, or make the model convex
The answer sits on a constraint boundary The constraint was handled as a penalty Use the KKT system, or an interior point method
It zig-zags and crawls Variables on wildly different scales Scale them; use a quasi-Newton method
It stops on a flat region, far from the bottom Gradient tolerance met too early Tighten it, restart, or check the curvature
Every evaluation costs a day The model is the computer run Surrogate model, then optimise the surrogate

Used in this collection

Back to the map: the nine kinds puts this class among the other eight.

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Layout

How pages are arranged. Your colours stay the same.

Reading offline

Keep this book on this device and read it offline.