The normal equations
The Gauss–Newton step, the damped step and the mean of a Gaussian factor all solve one linear system, the normal equations, whose matrix is the precision and whose determinant normalizes the integral; forming that matrix squares the condition number, a linear term costs the square whatever is done, and a linear term in the row space is therefore folded into the right-hand side.
The two readings of a linearization end in the same computation. Read as a model in a trust region, its step minimizes a quadratic. Read as an improper Gaussian factor, its mean, its precision and its integral are the answers. Both are a sum of squared affine rows and a linear term, and both come down to one linear system. This note states the system, says what each reading takes from it, and says what it costs to solve it the obvious way, which is what the note after it is written to avoid.
One system#
Stack the rows of every term into one matrix and one right-hand side , and write the linear term as . The function is
Let have rank , , , and
Then has exactly one minimizer , the solution of the normal equations
and for every
is positive definite, since for when has rank , so the normal equations have exactly one solution. is quadratic, with the gradient , which vanishes at , and the Hessian , so its Taylor expansion at is exact and is the first identity, which shows to be the one minimizer. The integral of over is for positive definite , and translating by gives the second.
∎Each of the earlier readings is this statement.
- The Gauss–Newton step. For the linearization, stacks the Jacobians and the right-hand sides , so is the Gauss–Newton matrix and by (2), and the solution is the step (4).
- The damped step. A damping adds , which is the square of the rows with a right-hand side of zero. Appended to , they turn the matrix into , and the solution is the damped step (5). For the stacked rows have full rank whatever has.
- The Gaussian factor. For the factor of Proposition 3, is a normal density of times a constant: its mean is , its precision , its covariance , and its integral the one above.
So the matrix of the normal equations is the curvature of the optimizer’s model and the precision of the estimator’s Gaussian, and their right-hand side is the negative gradient and the precision times the mean, the information vector. Writing a Gaussian by its precision and its information vector, rather than by its covariance and its mean, is its information form, and the normal equations are a Gaussian in information form.
What forming them costs#
The normal equations are the obvious way to compute , and the wrong one. Floating-point arithmetic rounds each operation with a relative error of at most the unit roundoff , about in double precision, and a linear system amplifies such errors by its condition number , the ratio of its extreme singular values: a solution computed stably is accurate to about , so that a solve loses about of its sixteen digits. The singular values of are the squares of those of , so , and forming the normal equations doubles the digits lost. A Jacobian with , common when variables have different scales, leaves ten digits to a method that works with and four to one that works with .
The loss can be total. With , take
The least-squares solution is , with zero residual, and , well within double precision. But , and rounds to , so the matrix of the normal equations, as computed, is singular. The information was lost when the matrix was formed, and no solver of the normal equations can recover it. A method that factors itself by orthogonal transformations, which preserve lengths and amplify no error, returns to full precision; the next note is that method.
A linear term, and a fold#
The solution splits by its sources, . The first part is the least-squares solution of , which a method that works with computes at the condition number . The second is a solve with the matrix itself, and is as sensitive as one, at , however it is computed: the sensitivity belongs to the map , and not to a method. A linear term costs the square of the condition number, always.
Unless it can be moved. A linear term in the row space of , for some vector , is the same function as a shift of the right-hand side,
and folded into it is solved with the rows, at . Only the part of a linear term outside the row space must stay one. This is why the linearization folds a log-volume into its own term’s right-hand side wherever the log-volume’s gradient lies in the term’s row space, and keeps in only the log-volumes that are functions of the point and not of the residual alone: on a model of Euclidean and curved quantities with fixed scales, every log-volume is folded, , and the whole step is solved at .
Where comes from. In exact arithmetic , and both terms of that difference are derivatives the linearization needs anyway. It should not be computed so. On a model whose log-volumes are all folded, is exactly zero, while and are each of the size of and each rounded: their difference is rounding of that size, not zero, and a linear term is amplified by in the solve. Read off the log-volumes that are not folded, is exactly zero wherever there are none, and otherwise only as large, and as rounded, as their own gradients.
Built on by
- Elimination in square-root form A sum of squared linear residuals and linear terms is minimized, integrated or marginalized one block of variables at a time by orthogonal factorizations of its rows, without ever forming its normal equations; each elimination leaves a conditional and a smaller problem of the same form.
- The Kalman filter The Kalman filter integrates the states of a linear-Gaussian chain out one at a time, so that what is left on each state is its prediction and, with its measurement, its update; its gain weighs the innovation, its evidence is the product of the innovations' densities, and in information or square-root form it is elimination along the chain, which carries a state its measurements do not yet determine.