skoro v0.0.0

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.

Updated 2026-11-25 · 5 min read

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 AA and one right-hand side bb, and write the linear term as η\eta. The function is

ϕ(v)=12∣Av−b∣2+η⊤v,(1) \phi(\tangent) = \tfrac12 \lvert A \tangent - b \rvert^2 + \eta\transpose \tangent , \tag{1}
(1)
Proposition 2(The normal equations).

Let A∈Rm×dA \in \R^{m \times \dimension} have rank d\dimension, b∈Rmb \in \R^m, η∈Rd\eta \in \R^\dimension, and

ϕ(v)=12∣Av−b∣2+η⊤v. \phi(\tangent) = \tfrac12 \lvert A \tangent - b \rvert^2 + \eta\transpose \tangent .

Then ϕ\phi has exactly one minimizer v∗\tangent^\ast, the solution of the normal equations

A⊤A v∗=A⊤b−η, A\transpose A\, \tangent^\ast = A\transpose b - \eta ,

and for every v\tangent

ϕ(v)=ϕ(v∗)+12(v−v∗)⊤A⊤A (v−v∗),∫Rde−ϕ(v) dv=(2π)d/2det⁡(A⊤A)−1/2 e−ϕ(v∗). \phi(\tangent) = \phi(\tangent^\ast) + \tfrac12 (\tangent - \tangent^\ast)\transpose A\transpose A\, (\tangent - \tangent^\ast) , \qquad \int_{\R^\dimension} e^{-\phi(\tangent)} \, \dd \tangent = (2\pi)^{\dimension / 2} \det (A\transpose A)^{-1/2}\, e^{-\phi(\tangent^\ast)} .
Proof.

A⊤AA\transpose A is positive definite, since v⊤A⊤A v=∣Av∣2>0\tangent\transpose A\transpose A\, \tangent = \lvert A \tangent \rvert^2 > 0 for v≠0\tangent \ne 0 when AA has rank d\dimension, so the normal equations have exactly one solution. ϕ\phi is quadratic, with the gradient A⊤(Av−b)+ηA\transpose (A \tangent - b) + \eta, which vanishes at v∗\tangent^\ast, and the Hessian A⊤AA\transpose A, so its Taylor expansion at v∗\tangent^\ast is exact and is the first identity, which shows v∗\tangent^\ast to be the one minimizer. The integral of e−12v⊤Pve^{-\frac12 \tangent\transpose P \tangent} over Rd\R^\dimension is (2π)d/2det⁡P−1/2(2\pi)^{\dimension/2} \det P^{-1/2} for positive definite PP, and translating by v∗\tangent^\ast gives the second.

∎

Each of the earlier readings is this statement.

  • The Gauss–Newton step. For the linearization, AA stacks the Jacobians JtJ_t and bb the right-hand sides −(rt+c^t)-(r_t + \hat c_t), so A⊤AA\transpose A is the Gauss–Newton matrix and A⊤b−η=−gA\transpose b - \eta = -g by (2), and the solution is the step (4).
  • The damped step. A damping adds 12λv⊤Dv\tfrac12 \lambda \tangent\transpose D \tangent, which is the square of the rows λ D1/2\sqrt \lambda\, D^{1/2} with a right-hand side of zero. Appended to AA, they turn the matrix into A⊤A+λDA\transpose A + \lambda D, and the solution is the damped step (5). For λ>0\lambda > 0 the stacked rows have full rank whatever AA has.
  • The Gaussian factor. For the factor of Proposition 3, e−ϕe^{-\phi} is a normal density of v\tangent times a constant: its mean is v∗\tangent^\ast, its precision A⊤AA\transpose A, its covariance (A⊤A)−1(A\transpose A)^{-1}, 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 v∗\tangent^\ast, and the wrong one. Floating-point arithmetic rounds each operation with a relative error of at most the unit roundoff uu, about 1.1×10−161.1 \times 10^{-16} in double precision, and a linear system amplifies such errors by its condition number κ(M)=σmax⁡(M)/σmin⁡(M)\kappa(M) = \sigma_{\max}(M) / \sigma_{\min}(M), the ratio of its extreme singular values: a solution computed stably is accurate to about u κu\, \kappa, so that a solve loses about log⁡10κ\log_{10} \kappa of its sixteen digits. The singular values of A⊤AA\transpose A are the squares of those of AA, so κ(A⊤A)=κ(A)2\kappa(A\transpose A) = \kappa(A)^2, and forming the normal equations doubles the digits lost. A Jacobian with κ(A)=106\kappa(A) = 10^6, common when variables have different scales, leaves ten digits to a method that works with AA and four to one that works with A⊤AA\transpose A.

The loss can be total. With ε=10−8\varepsilon = 10^{-8}, take

A=[11ε00ε],b=[2εε]. A = \begin{bmatrix} 1 & 1 \\ \varepsilon & 0 \\ 0 & \varepsilon \end{bmatrix} , \qquad b = \begin{bmatrix} 2 \\ \varepsilon \\ \varepsilon \end{bmatrix} .

The least-squares solution is (1,1)(1, 1), with zero residual, and κ(A)≈1.4×108\kappa(A) \approx 1.4 \times 10^8, well within double precision. But A⊤A=[1+ε2111+ε2]A\transpose A = \left[\begin{smallmatrix} 1 + \varepsilon^2 & 1 \\ 1 & 1 + \varepsilon^2 \end{smallmatrix}\right], and 1+10−161 + 10^{-16} rounds to 11, 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 AA itself by orthogonal transformations, which preserve lengths and amplify no error, returns (1,1)(1, 1) to full precision; the next note is that method.

A linear term, and a fold#

The solution splits by its sources, v∗=(A⊤A)−1A⊤b−(A⊤A)−1η\tangent^\ast = (A\transpose A)^{-1} A\transpose b - (A\transpose A)^{-1} \eta. The first part is the least-squares solution of Av=bA \tangent = b, which a method that works with AA computes at the condition number κ(A)\kappa(A). The second is a solve with the matrix A⊤AA\transpose A itself, and is as sensitive as one, at κ(A)2\kappa(A)^2, however it is computed: the sensitivity belongs to the map η↦(A⊤A)−1η\eta \mapsto (A\transpose A)^{-1} \eta, 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 AA, η=A⊤c\eta = A\transpose c for some vector cc, is the same function as a shift of the right-hand side,

12∣Av−b∣2+c⊤Av=12∣Av−(b−c)∣2+c⊤b−12∣c∣2,(3) \tfrac12 \lvert A \tangent - b \rvert^2 + c\transpose A \tangent = \tfrac12 \lvert A \tangent - (b - c) \rvert^2 + c\transpose b - \tfrac12 \lvert c \rvert^2 , \tag{3}
(3)

and folded into bb it is solved with the rows, at κ(A)\kappa(A). 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 η\eta 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, η=0\eta = 0, and the whole step is solved at κ(J)\kappa(J).

Where η\eta comes from. In exact arithmetic η=g−∑tJt⊤(rt+c^t)\eta = g - \sum_t J_t\transpose (r_t + \hat c_t), 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, η\eta is exactly zero, while gg and ∑tJt⊤rt\sum_t J_t\transpose r_t are each of the size of ∣J∣∣r∣\lvert J \rvert \lvert r \rvert and each rounded: their difference is rounding of that size, not zero, and a linear term is amplified by κ(J)2\kappa(J)^2 in the solve. Read off the log-volumes that are not folded, η\eta is exactly zero wherever there are none, and otherwise only as large, and as rounded, as their own gradients.

Built on by