skoro v0.0.0

Models of normals as least squares

When every term of a model is a normal with a fixed scale and a mean computed from other quantities, its negative log-density is half a sum of squared whitened residuals plus the charts' log-volumes and a constant, so its mode is a nonlinear least-squares problem; a scale that is estimated breaks the form.

Updated 2026-11-25 · 3 min read

The mode of a posterior is the minimizer of a sum of terms, one for each of the model’s kernels. For one family of models, by far the most common in estimation, each term is a square. A quantity measured with Gaussian noise, a state that follows another up to Gaussian noise, a parameter with a Gaussian prior: each is a normal whose mean is computed from other quantities, and a model built of such terms, its means depending on quantities that are themselves scored by normals, is hierarchical in the plainest sense. This note shows that its mode is a nonlinear least-squares problem, says what the problem keeps of the density besides its squares, and where the form breaks.

A sum of squares, and what else#

Proposition 1(The mode of a model of normals is a least-squares problem).

Let every term of a model built forward be a normal N(μt(x),Σt)\mathcal N\bigl(\mu_t(\point), \Sigma_t\bigr) on a space with a global chart, scoring one quantity xst\point_{s_t}, whether free or observed, with a mean μt\mu_t computed smoothly from other quantities and a scale Σt\Sigma_t that is fixed, with the whitening WtW_t. Then the objective of Definition 1 is

f(xF)=∑t(12∣rt(xF)∣2+λt(xF))+a constant,rt=Wt(xst⊖μt(x)), f(\point_F) = \sum_t \Bigl( \tfrac12 \lvert r_t(\point_F) \rvert^2 + \lambda_t(\point_F) \Bigr) + \text{a constant}, \qquad r_t = W_t \bigl( \point_{s_t} \ominus \mu_t(\point) \bigr) ,

with λt\lambda_t the log-volume of the chart at μt\mu_t, read at xst⊖μt\point_{s_t} \ominus \mu_t, and the observed quantities held at their values. Its minimizers are those of a sum of squared residuals, corrected by the log-volumes.

Proof.

By (5), ff is the sum of the terms’ negative log-densities. By (1), the term of a normal scoring xst\point_{s_t} with mean μt\mu_t and whitening WtW_t is

−ℓN=12∣rt∣2−∑ilog⁡(Wt)ii+dt2log⁡2π+λμt(xst⊖μt), -\logterm_{\mathcal N} = \tfrac12 \lvert r_t \rvert^2 - \sum_i \log (W_t)_{ii} + \tfrac{d_t}{2} \log 2\pi + \lambda_{\mu_t}(\point_{s_t} \ominus \mu_t) ,

with dtd_t the dimension of the quantity’s space. The scale is fixed, so the middle two summands are constants.

∎

The objective is written, from here on, as

f(x)=∑t(12∣rt(x)∣2+λt(x))+a constant,(2) f(\point) = \sum_t \Bigl( \tfrac12 \lvert r_t(\point) \rvert^2 + \lambda_t(\point) \Bigr) + \text{a constant}, \tag{2}
(2)

a sum over terms tt, each with a smooth whitened residual rtr_t, of any number of components, and a smooth scalar λt\lambda_t, which for many terms is zero, over a point x=(x1,…,xn)\point = (\point_1, \dots, \point_n) of a product of manifolds with retractions, the free quantities. Each term reads only a few of the factors of x\point, its variables KtK_t: the quantity it scores, if that is free, and the free quantities its mean is computed from. The notes that follow use only this form, and the terms need not come from normals: any function of this shape is minimized by the same methods.

The squares are what least squares sees. A residual is the difference between a quantity and the mean the model predicts for it, in the coordinates of the chart at the mean and in units of its noise. Its square is the measurement’s disagreement with the model, and the sum of squares is what an engineer would write down as the cost of a fit without any probability at all. Minimizing it alone is the classical problem.

The log-volumes are what make ff a negative log-density. The log-volume λt\lambda_t is zero on a Euclidean space. On the positive orthant it is ∑ilog⁡xst,i\sum_i \log \point_{s_t, i}, which depends on the scored quantity and not only on its residual. On a curved space, such as the rotations with the Cayley chart, it is a function of the residual’s coordinates, of the relative order of the noise’s variance near a zero residual. Leaving the log-volumes out minimizes the sum of squares alone, which is the mode of another model, and keeping them finds the mode of this one against the reference measure of its spaces. On Euclidean spaces the two coincide.

A residual of no components. A term may have rtr_t of no components and a nonzero λt\lambda_t: a factor that adds a function of the point and no square. It fits the form, and the methods of the following notes carry its gradient exactly.

Where the form breaks#

The form rests on the normalizers being constant, and so on the scales being fixed. A scale that is itself a free quantity breaks it in two places. The normalizer −∑ilog⁡(Wt)ii-\sum_i \log (W_t)_{ii} is then a function of the point, and so is the residual, through WtW_t. For an isotropic scale σ\sigma, in its logarithmic chart u=log⁡σu = \log \sigma, the residual is e−u(xst⊖μt)e^{-u} (\point_{s_t} \ominus \mu_t) and the normalizer is dtud_t u: the first falls as the scale grows and the second rises. Such an objective is still a sum of squares and a smooth remainder, and the methods of the following notes still apply to it, but the remainder is now as large as the squares near the mode, and the methods that neglect the curvature of the squares’ residuals lose their reason. A scale is estimated by a curvature that keeps its share, the expected information, which a later note takes up.

Built on by