skoro v0.0.0

The improper Gaussian factor

A sum of squared affine rows of any number, a linear term and a constant, in the tangent coordinates of several points at fixed anchors, is Gaussian along its rows and flat or linear across them; the linearization of a sum of squares is one, a Gaussian factor on the increment from the point of linearization whose mean is the Gauss–Newton step, and such factors add and are a normal exactly when their rows have full rank.

Updated 2026-11-25 · 9 min read

Integrating a quantity out of a model leaves a function of the quantities it was tied to, its Markov blanket. For a model of normals that function is Gaussian in shape, and it is tempting to write it as a normal density of the blanket. A normal density has a covariance, though, and so can only describe a function that pins down every direction of the blanket. Many do not. A landmark seen by bearing from a single pose is the standard case: once the pose is integrated out, the bearing has said in which direction the landmark lies, and nothing about how far. What is left is Gaussian across the bearing and constant along it, and no covariance describes it. Forced into a normal, it must either be refused or be given a depth that the data never supplied.

The same function appears earlier, and more often, without any integral. The linearization of a sum of squares at a point is a quadratic model of the function, read by an optimizer as something to minimize. Its exponential is Gaussian in the step along its rows and flat across them, and it is a statement about the increment from the point of linearization to the point: what the residuals, once made affine, say of where the point lies.

This note defines the function that describes both: the improper Gaussian factor. It keeps exactly what was said and nothing more, such factors add, and when one does determine its points it is a normal. Read on a linearization, it is the second reading of the same model, a Gaussian where the note before saw a model in a trust region.

The factor#

Let x1,…,xk\point_1, \dots, \point_k be points of manifolds of dimensions d1,…,dk\dimension_1, \dots, \dimension_k, each with a retraction, and fix for each an anchor pip_i in its manifold. The stacked tangent is the vector of their coordinates in the charts at the anchors,

δ(xB)=(x1⊖p1, …, xk⊖pk)∈RD,D=∑idi,(1) \delta(\point_B) = (\point_1 \ominus p_1,\ \dots,\ \point_k \ominus p_k) \in \R^D, \qquad D = \sum_i \dimension_i , \tag{1}
(1)

the tuple standing, here and below, for the column vector with its entries stacked. The anchors are fixed points, and do not move with the points the factor is a function of.

Definition 2(The improper Gaussian factor).

Let xB=(x1,…,xk)\point_B = (\point_1, \dots, \point_k) be points of manifolds with retractions, with anchors pip_i and the stacked tangent δ(xB)∈RD\delta(\point_B) \in \R^D of (1). Given a matrix A∈Rr×DA \in \R^{r \times D}, for any number r≥0r \ge 0 of rows, a vector b∈Rrb \in \R^r, a vector η∈RD\eta \in \R^D and a constant cc, the improper Gaussian factor is the function

ℓ(xB)=−12∣A δ(xB)−b∣2−η⊤δ(xB)+c. \logterm(\point_B) = -\tfrac12 \bigl\lvert A\, \delta(\point_B) - b \bigr\rvert^2 - \eta\transpose \delta(\point_B) + c .

Its whitened residual is Aδ−bA \delta - b, of rr components, and its linear part is η⊤δ\eta\transpose \delta.

The rows say what the factor determines. Write δ=δ∥+δ⊥\delta = \delta_\parallel + \delta_\perp, with δ∥\delta_\parallel in the row space of AA and δ⊥\delta_\perp in its null space. Along the row space the squares are a Gaussian. Along the null space the squares do not change, and the factor is linear, with slope −η⊤δ⊥-\eta\transpose \delta_\perp. A factor with r=0r = 0 rows is linear and a constant alone.

The factor is a likelihood factor: a nonnegative function eℓe^\logterm of quantities of a model, which reweights the model’s law and is not the density of anything. It therefore needs no reference measure and no log-volume, even over a curved or a positive quantity. Whatever measure an integral was taken in before the factor was written is already in its values.

When it is a normal#

Proposition 3(A factor of full rank is a normal).

As a function of δ∈RD\delta \in \R^D, eℓe^{\logterm} is integrable if and only if AA has rank DD. When it has, let WW be the lower-triangular matrix with a positive diagonal and W⊤W=A⊤AW\transpose W = A\transpose A, and

m=(A⊤A)−1(A⊤b−η),cN=c+12∣Wm∣2−12∣b∣2−∑ilog⁡Wii+D2log⁡2π. m = (A\transpose A)^{-1} (A\transpose b - \eta) , \qquad c_{\mathcal N} = c + \tfrac12 \lvert W m \rvert^2 - \tfrac12 \lvert b \rvert^2 - \sum_i \log W_{ii} + \tfrac{D}{2} \log 2\pi .

Then ℓ(xB)=ℓN(δ(xB); m,W)+cN\logterm(\point_B) = \logterm_{\mathcal N}\bigl(\delta(\point_B);\, m, W\bigr) + c_{\mathcal N}, with ℓN\logterm_{\mathcal N} the normal’s log-density on RD\R^D: the factor is a normal density of the stacked tangent, with the mean mm and the whitening WW, times a constant.

Proof.

If AA has rank less than DD, take n≠0n \ne 0 with An=0A n = 0. Along the line δ+tn\delta + t n the factor is ℓ(δ)−t η⊤n\logterm(\delta) - t\, \eta\transpose n, so eℓe^{\logterm} is constant or grows exponentially along every such line, and the integral over RD\R^D diverges. If AA has rank DD, Λ=A⊤A=W⊤W\Lambda = A\transpose A = W\transpose W is positive definite, and

−12∣Aδ−b∣2−η⊤δ=−12δ⊤Λδ+δ⊤(A⊤b−η)−12∣b∣2=−12∣W(δ−m)∣2+12∣Wm∣2−12∣b∣2, \begin{aligned} -\tfrac12 \lvert A \delta - b \rvert^2 - \eta\transpose \delta &= -\tfrac12 \delta\transpose \Lambda \delta + \delta\transpose (A\transpose b - \eta) - \tfrac12 \lvert b \rvert^2 \\ &= -\tfrac12 \lvert W (\delta - m) \rvert^2 + \tfrac12 \lvert W m \rvert^2 - \tfrac12 \lvert b \rvert^2 , \end{aligned}

since Λm=A⊤b−η\Lambda m = A\transpose b - \eta. The first term is ℓN(δ; m,W)−∑ilog⁡Wii+D2log⁡2π\logterm_{\mathcal N}(\delta;\, m, W) - \sum_i \log W_{ii} + \tfrac{D}{2} \log 2\pi by (1) on RD\R^D, where the log-volume vanishes, and it is integrable. Adding cc gives cNc_{\mathcal N}.

∎

So the factors of full rank are the normal densities of the stacked tangent, and the improper factors are everything else of the same shape. Integrability in δ\delta is the only difference between them, and a likelihood factor never needed it. Integrability in δ\delta is also not integrability against the reference measure of the points’ own spaces, which carries the chart’s volume: on a compact curved space such as the rotations, a bounded factor of any rank is integrable against the space’s measure, and on a positive space the two differ by the factor x\point. What matters below is the reading in δ\delta, where the factor is Gaussian or flat.

What integrability does change is drawing. A quantity whose only information is an improper factor has no law to be drawn from, and is a parameter with a score. Where the factor has full rank over Euclidean points, drawing δ\delta from the normal of Proposition 3 and setting xi=pi⊕δi\point_i = p_i \oplus \delta_i is a proposal under which every draw has the same weight.

The linearization is a factor#

Take the linearization mm of the objective ff at x^\hat \point, anchor every factor of the point at x^\hat \point itself, so that the stacked tangent is the increment δ(x)=x⊖x^\delta(\point) = \point \ominus \hat \point, and set

A=[⋮Jt⋮],b=−[⋮rt+c^t⋮],c=−c0, A = \begin{bmatrix} \vdots \\ J_t \\ \vdots \end{bmatrix} , \qquad b = -\begin{bmatrix} \vdots \\ r_t + \hat c_t \\ \vdots \end{bmatrix} , \qquad c = -c_0 ,

with the linear term η\eta of the linearization. Then −m(δ)-m(\delta) is the improper Gaussian factor with these rows, term for term, and since m(v)m(\tangent) agrees with f(x^⊕v)f(\hat \point \oplus \tangent) to first order,

e−f(x)≈eℓ(x)=e−m(x⊖x^)(4) e^{-f(\point)} \approx e^{\logterm(\point)} = e^{-m(\point \ominus \hat \point)} \tag{4}
(4)

near x^\hat \point. Linearizing the residuals is saying that the increment from the point of linearization to the point has a Gaussian factor. Each term contributes its own rows, so the factor is a sum of factors, one for each term, over the term’s variables; it is the linearization’s structure read as a sum of likelihoods.

When the rows have full rank, the factor is by Proposition 3 a normal of the increment. Its mean (A⊤A)−1(A⊤b−η)=−(∑tJt⊤Jt)−1g(A\transpose A)^{-1}(A\transpose b - \eta) = -(\sum_t J_t\transpose J_t)^{-1} g, by (2), is the Gauss–Newton step (4), and its precision A⊤AA\transpose A is the Gauss–Newton matrix. The optimizer’s minimizer and the estimator’s mean are one vector, and the optimizer’s curvature and the estimator’s precision one matrix. When the rows do not have full rank, the optimizer has no step and the estimator no mean, for the same reason: some direction of the increment is not determined, and the factor is flat or linear along it.

A damping is a factor too. The penalty 12λ δ⊤Dδ\tfrac12 \lambda\, \delta\transpose D \delta of the damped step (5) is, as a factor, a normal of the increment with mean zero and precision λD\lambda D: a prior that the point lies near x^\hat \point. Adding it to the linearization’s factor, as factors add, gives a factor of full rank whose mean is the damped step. The trust region’s radius is, in this reading, set by the prior: the tighter the prior, the shorter the step.

The factor is a likelihood factor in δ\delta, and eℓe^{\logterm} approximates e−fe^{-f}, a density against the reference measure of the points’ spaces. As a density of δ\delta against Lebesgue measure, the posterior near x^\hat \point is e−f(x^⊕δ)e^{-f(\hat \point \oplus \delta)} times the volume of the chart, by (4); the two differ on a curved space, and the Gaussian fitted to a posterior in a chart keeps the chart’s volume.

Two examples#

A bearing in the plane. Take a landmark ℓ∈R2\ell \in \R^2 and poses xk∈R2\point_k \in \R^2, each with its own prior N(pk,Pk)\mathcal N(p_k, P_k), and a measurement of each pose along a known unit direction aka_k,

zk=ak⊤(ℓ−xk)+εk,εk∼N(0,σ2), z_k = a_k\transpose (\ell - \point_k) + \varepsilon_k , \qquad \varepsilon_k \sim \mathcal N(0, \sigma^2) ,

a linear stand-in for a bearing, which measures the landmark’s offset from the pose across one direction only. Integrate the pose xk\point_k out, with zkz_k observed at z^k\hat z_k. Then ak⊤ℓ−zka_k\transpose \ell - z_k is normal with mean ak⊤pka_k\transpose p_k and variance sk2=σ2+ak⊤Pkaks_k^2 = \sigma^2 + a_k\transpose P_k a_k, so that, with the anchor qq for ℓ\ell and δ=ℓ−q\delta = \ell - q,

ℓk(ℓ)=−12sk2(ak⊤δ−(z^k+ak⊤pk−ak⊤q))2−12log⁡(2πsk2). \logterm_k(\ell) = -\frac{1}{2 s_k^2} \bigl(a_k\transpose \delta - (\hat z_k + a_k\transpose p_k - a_k\transpose q)\bigr)^2 - \tfrac12 \log (2\pi s_k^2) .

This is the factor with one row, A=ak⊤/skA = a_k\transpose / s_k, b=(z^k+ak⊤pk−ak⊤q)/skb = (\hat z_k + a_k\transpose p_k - a_k\transpose q) / s_k, η=0\eta = 0 and c=−12log⁡(2πsk2)c = -\tfrac12 \log (2\pi s_k^2), exactly. It has rank one on R2\R^2 and is constant along the direction orthogonal to aka_k: the line on which the measurement places the landmark. A second pose with a direction ak′a_{k'} not parallel to aka_k gives a second such factor. Their sum has two rows of rank two, and is by Proposition 3 a normal, whose mean is the point at which the two lines cross.

A positive quantity. Let a positive quantity x\point have the normal on the positive reals with the mean eθ+φe^{\theta + \varphi} and the scale σ\sigma, where θ∼N(0,1)\theta \sim \mathcal N(0, 1) is real, and integrate θ\theta out, keeping φ\varphi and x\point. The normal’s log-density on the positive reals is the Gaussian of log⁡x\log \point less the log-volume log⁡x\log \point, so

ℓB(φ,x)=log⁡∫N(θ; 0,1) 1x N(log⁡x; θ+φ,σ2) dθ=−log⁡x−(log⁡x−φ)22s2−12log⁡(2πs2), \begin{aligned} \logterm_B(\varphi, \point) &= \log \int \mathcal N(\theta;\, 0, 1)\, \frac{1}{\point}\, \mathcal N(\log \point;\, \theta + \varphi, \sigma^2) \, \dd \theta \\ &= -\log \point - \frac{(\log \point - \varphi)^2}{2 s^2} - \tfrac12 \log (2\pi s^2) , \end{aligned}

with s2=1+σ2s^2 = 1 + \sigma^2. In the stacked tangent at the anchors (φ^,x^)(\hat \varphi, \hat \point), δ=(φ−φ^, log⁡x−log⁡x^)\delta = (\varphi - \hat \varphi,\, \log \point - \log \hat \point), it is the factor with

A=1s[−11],b=−log⁡x^−φ^s,η=(0,1),c=−log⁡x^−12log⁡(2πs2). A = \tfrac{1}{s} \begin{bmatrix} -1 & 1 \end{bmatrix} , \qquad b = -\frac{\log \hat \point - \hat \varphi}{s} , \qquad \eta = (0, 1) , \qquad c = -\log \hat \point - \tfrac12 \log (2\pi s^2) .

The linear term is not in the row space of AA: by part 3 of Lemma 5 below, at most its projection onto that space, (−12,12)(-\tfrac12, \tfrac12), can be moved into bb, and (12,12)(\tfrac12, \tfrac12) remains. Along the null direction (1,1)(1, 1) the factor falls linearly. This is why the factor carries η\eta: a log-volume that depends on the point and not only on a residual, as the positive reals’ does, leaves a slope that no row can hold.

Forms of one factor#

Lemma 5(Forms of one factor).

Each of the following changes (A,b,η,c)(A, b, \eta, c) and leaves the value of the factor unchanged at every xB\point_B:

  1. for an orthogonal Q∈Rr×rQ \in \R^{r \times r}, (Q⊤A, Q⊤b, η, c)(Q\transpose A,\, Q\transpose b,\, \eta,\, c);
  2. if [A   b]=[A′b′0e][A \;\, b] = \begin{bmatrix} A' & b' \\ 0 & e \end{bmatrix}, with zero rows in AA below A′A', (A′, b′, η, c−12∣e∣2)(A',\, b',\, \eta,\, c - \tfrac12 \lvert e \rvert^2);
  3. for any u∈Rru \in \R^r, (A, b−u, η−A⊤u, c−u⊤b+12∣u∣2)(A,\, b - u,\, \eta - A\transpose u,\, c - u\transpose b + \tfrac12 \lvert u \rvert^2).

Moving the anchor pip_i of each point xi\point_i of a space that is flat in disguise to pi′=pi⊕wip_i' = p_i \oplus w_i, and keeping the anchors of the others, with w∈RDw \in \R^D stacked from the wiw_i and zero in the blocks of the anchors kept, also leaves it unchanged with (A, b−Aw, η, c−η⊤w)(A,\, b - A w,\, \eta,\, c - \eta\transpose w).

Proof.

For part 1, ∣Q⊤(Aδ−b)∣=∣Aδ−b∣\lvert Q\transpose (A \delta - b) \rvert = \lvert A \delta - b \rvert. For part 2, the squares of the zero rows are ∣0⋅δ−e∣2=∣e∣2\lvert 0 \cdot \delta - e \rvert^2 = \lvert e \rvert^2. For part 3, expanding the square,

−12∣Aδ−(b−u)∣2−(η−A⊤u)⊤δ=−12∣Aδ−b∣2−u⊤(Aδ−b)−12∣u∣2−η⊤δ+u⊤Aδ=−12∣Aδ−b∣2−η⊤δ+u⊤b−12∣u∣2, \begin{aligned} -\tfrac12 \lvert A \delta - (b - u) \rvert^2 - (\eta - A\transpose u)\transpose \delta &= -\tfrac12 \lvert A \delta - b \rvert^2 - u\transpose (A \delta - b) - \tfrac12 \lvert u \rvert^2 - \eta\transpose \delta + u\transpose A \delta \\ &= -\tfrac12 \lvert A \delta - b \rvert^2 - \eta\transpose \delta + u\transpose b - \tfrac12 \lvert u \rvert^2 , \end{aligned}

and the new constant restores cc. For the anchors, xi⊖pi′=(xi⊖pi)−wi\point_i \ominus p_i' = (\point_i \ominus p_i) - w_i by (5), and the blocks of the anchors kept are unchanged, so δ=δ′+w\delta = \delta' + w in the new stacked tangent δ′\delta', and substituting gives the new right-hand side and constant.

∎

Parts 1 and 2 together are an orthogonal factorization of [A   b][A \;\, b]. It leaves at most DD rows, so a factor never needs more rows than its points have coordinates. Part 3 moves any part of η\eta that lies in the row space into bb. Choosing uu to minimize ∣η−A⊤u∣\lvert \eta - A\transpose u \rvert leaves only the part of η\eta in the null space, which no form removes. When AA has rank DD, that part is zero, and the form is the normal’s of Proposition 3. None of these changes the value: a factor is the function it is, whichever form it is given in.

Accumulation#

Factors over the same points add. Two factors over sets of points B1B_1 and B2B_2, with the same anchor for each point they share, sum to a factor over B1∪B2B_1 \cup B_2, whose rows are the two sets of rows, each with zero columns for the points it does not involve, whose linear term is the sum of the two, each extended by zeros, and whose constant is the sum. The sum’s value is the sum of the values, at every point, by the definition alone. Its rows can then be reduced by Lemma 5 to at most DD, and once they have rank DD it is a normal.

The sum is exact when the anchors agree, and whatever the anchors of the points of spaces flat in disguise, since the last part of Lemma 5 moves those anchors without changing the factor’s value. On a curved space, the stacked tangent at one anchor is not an affine function of the stacked tangent at another, and two factors anchored differently are two functions, not one factor.

The example of the bearings shows what accumulation buys. A filter that drops each pose as it is done with it is left with one row on the landmark each time. The landmark is undetermined until two rows of different directions have accumulated, and until then a question that needs it determined has no unique answer. After that it is estimated, and nothing was lost on the way.

Derivatives#

The factor is a function of its points through δ\delta, and its derivatives in charts are those of its two parts. In the chart at xi\point_i, the block of δ\delta for xi\point_i has the derivative D(xi⊖pi)\D(\point_i \ominus p_i), which is the identity at xi=pi\point_i = p_i and everywhere on a space flat in disguise, and on a curved space moves with xi\point_i. So the residual Aδ−bA \delta - b has the Jacobian A DδA\, \D \delta, and the linear part has the gradient Dδ⊤η\D \delta\transpose \eta.

On the spaces flat in disguise, δ\delta is affine in every chart of its points, so the factor is exactly quadratic in it. Its residual’s Jacobian is constant, the matrix Dδ⊤A⊤A Dδ\D \delta\transpose A\transpose A\, \D \delta is its exact negative Hessian, and the linear part has no curvature. On a curved space the factor has the curvature that δ\delta has: it vanishes at the anchors and is of first order in δ\delta near them.

Built on by