Maths Applied1.3 Two legs, one contradiction

All books

What least squares is minimising

The main thread uses least squares as a tool: when there are more equations than unknowns, minimise the squared error and carry on. This page is about what that sentence means, and why the tool is the right shape for the job.

The residual is a point in three dimensions

At any guess DD for the upper ball joint, the three equations give three numbers: how far the first leg is from its length, the second, and the upright. Collect them into a vector:

r(D)=(r1, r2, r3)∈R3.\mathbf{r}(D) = \left(r_1,\ r_2,\ r_3\right) \in \mathbb{R}^3.

Exact satisfaction would mean r=0\mathbf{r} = 0: the origin of that space. When the model is consistent, the origin is reachable. When it is not, the origin is out there in space and the best you can do is get as close to it as the mechanism allows.

"Close" is measured with the length of r\mathbf{r}, and least squares minimises

S(D)=12∣r(D)∣2=12(r12+r22+r32).S(D) = \tfrac12\left|\mathbf{r}(D)\right|^2 = \tfrac12\left(r_1^2 + r_2^2 + r_3^2\right).

Why squares

Three reasons, in increasing order of importance.

So least squares is not "an error measure someone chose". It is the geometry of being closest, and the perpendicular is why the normal equations have the shape they have.

The compromise, and what it hides

When the equations genuinely disagree, least squares returns the point that splits the difference — and this is worth being suspicious of.

A model with one bad equation therefore produces a plausible pose, a residual that looks small compared with anything you can see, and a camber curve that is subtly wrong. The residual is an error bar on the solver, not on the model.

What the stopping test really is

An iteration that minimises SS has finished when moving in any direction would increase it. Differentiating, that condition is

JTr=0,J^{\mathsf{T}}\mathbf{r} = 0,

which is not the same as r=0\mathbf{r} = 0. A least-squares solve has converged when it can no longer improve — not when it has satisfied the equations.

That distinction is why the numbers in the main thread's table fall to the round-off floor and then stop. They are not getting closer to zero because the solver gave up. They are at the point where the solver has nothing left to improve, and the leftover is the arithmetic's own noise.

Why not the smallest possible misfit instead

A different-looking rule — minimise the largest of the three errors rather than the sum of their squares — gives a different compromise, and for some problems a better one. It is also harder to solve, and it does not have the projection property.

Least squares is chosen here because it is the compromise that the mechanism's own geometry produces: the directions in which the point can move, and the perpendicular to them. That is the sense in which it is not arbitrary.

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.