---
summary: skoro's one normal distribution, the law of a point moved by normal noise through its chart, defined on every space whose chart is global and whose volume is known, so that flat, positive and curved quantities alike, measurements among them, are drawn and scored exactly; with its scale, its sampler, its properties, its expected information, its roles, and its use as a likelihood factor.
depends_on: [retraction, product-manifold, derivatives-in-charts, chart-volume, archive/core/math, archive/measures/math]
---

# Mathematics

## The problem

[The core](/archive/core/math.md) can build, query and differentiate a model, but it has no
distribution: a term's log-density is whatever composite its author writes, and its tests keep a
private normal of a real quantity for want of a public one. The normal distribution is the one
nearly every model skoro is meant for reaches first. A prior on a state, a motion model, a
measurement with Gaussian noise, and the replacement a retirement leaves behind under a Laplace
approximation are all normal. It is therefore the first distribution to return from the `archive`
branch.

The archive's normal was written for any manifold, as the law of the mean moved by normal noise,
$\mu \oplus \varepsilon$, and that form is the one skoro needs. A measurement of a rotation, of a
direction or of a pose is most cleanly modelled as what was measured, the predicted quantity moved
by noise, $h(\point) \oplus \varepsilon$, rather than as the residual of a normal; and a model that
holds the measurement itself can observe it in one query and simulate it in another. The archive's
fault was its density, the Gaussian log-density of the tangent $\point \ominus \mu$ alone, which
omitted the volume of the chart at the mean. On the core's positive orthant that omission is the
Jacobian of the logarithmic chart, without which the density is not with respect to the base
measure the core fixes ([](eq:archive/core/math/log-chart-density)); on the rotations it is the
volume factor of the retraction, without which the density is that of no law the sampler draws.

The charter fixes what the normal must therefore be. A model is generative and has a true density,
and its generation carries an importance weight, so the normal's term must be the exact density of
the law its sampler draws, with respect to the reference measure of the scored quantity's type.
Models are built forward and conditioned in queries, and curved quantities are both estimated
states and observables, so the scored quantity may be of any continuous type, and its mean a value
computed from any other quantities. [The core's measures](/archive/measures/math.md) give every
continuous type that declares one a reference measure and the volume of its retraction's chart.
This document defines the normal once, on every type whose chart is global and whose volume is
known, shows its density and its sampler exact there, and works out what the rest of skoro will
need of it: how its scale is given, its properties, its expected information, the roles it binds,
and its use as a likelihood factor over values that are not quantities.

## Setting

**The spaces.** The normal lives on a continuous type with a volume, in the sense of
[the core's measures](/archive/measures/math.md): a space $\manifold$ of dimension $\dimension$ with a
reference measure $\nu$, and at every $\mu \in \manifold$ the chart $\tangent \mapsto \mu \oplus
\tangent$ of its [retraction](/math/retraction.md), with a domain $U_\mu \subseteq
\R^\dimension$, an image $V_\mu$ whose complement has measure zero, and the log-volume
$\lambda_\mu(\tangent) = \Lambda(\iota(\mu), \tangent)$ [](eq:archive/measures/math/declared)
([%full](statement:math/chart-volume/chart-volume)). On $V_\mu$, $\point \ominus \mu$ is the inverse
of the chart. The chart is *global* when $U_\mu = \R^\dimension$ at every $\mu$, and the normal is
defined on the types whose chart is global ([Why global charts](#why-global-charts)). They are:

- the core's own continuous types, the real line, vectors $\R^n$, matrices $\R^{m \times n}$ read
  as vectors column by column, and the positive orthant $\positive^n$ with its retraction
  [](eq:archive/core/math/positive), all with Lebesgue measure
  ([%full](statement:archive/measures/math/core-types));
- the embedded types that declare a volume with a global chart, such as the rotations with the
  Cayley chart and the sphere with the stereographic chart of
  [the note's table](/math/chart-volume.md#the-usual-charts);
- products of these, with the stacked tangent [](eq:math/product-manifold/stack), the product
  measure and the sum of the factors' log-volumes, such as a pose held as a rotation and a position
  in a fixed frame of the world.

**The flat-in-disguise spaces.** Among them, the core's own types and their products have a
property no curved type has. For such a space and any $\mu$, $\point \mapsto \point \ominus \mu$ is
a diffeomorphism of $\manifold$ onto $\R^\dimension$, and both identities

$$
	(\point \oplus \tangent) \ominus \mu = (\point \ominus \mu) + \tangent,
	\qquad
	\point \ominus (\mu \oplus u) = (\point \ominus \mu) - u @tag(translation)
$$

hold exactly, for every $\tangent$ and $u$: on a Euclidean factor because $\ominus$ is subtraction,
and on a positive one because it is subtraction of logarithms. This document calls these spaces
*flat-in-disguise*. Their log-volume is, by [%full](statement:archive/measures/math/core-types),

$$
	\lambda_\mu(\point \ominus \mu) = J(\point) = \sum_{i \in P} \log \point_i , @tag(jacobian)
$$

with $P$ the storage coordinates that belong to positive factors, and zero on a space with none.

**The mean and the scale.** The normal's *mean* is $\mu \in \manifold$, and its *scale* is a
symmetric positive definite $\dimension \times \dimension$ matrix, given in one of the forms of
[The scale](#the-scale) and read, in every one of them, through its *whitening* $W$: the
lower-triangular matrix with a positive diagonal such that the precision $\Lambda = \Sigma^{-1}$ is
$W\transpose W$. Then $L = W^{-1}$ is lower triangular with a positive diagonal and
$\Sigma = L L\transpose$. Both are unique: $L$ is the Cholesky factor of $\Sigma$.

## The definition

The normal $\mathcal N(\mu, \Sigma)$ on a space $\manifold$ whose chart is global is the law of
$\mu \oplus \varepsilon$, where $\varepsilon$ is normal on $\R^\dimension$ with mean zero and
covariance $\Sigma$. Where its construction needs naming, it is the *tangent normal*: a normal in
the tangent chart at $\mu$, pushed onto the space. Its term is

$$
	\logterm_{\mathcal N}(\point;\, \mu, W)
	= -\tfrac12 \bigl\lvert W (\point \ominus \mu) \bigr\rvert^2
	+ \sum_{i=1}^{\dimension} \log W_{ii}
	- \tfrac{\dimension}{2} \log 2\pi
	- \lambda_\mu(\point \ominus \mu) , @tag(term)
$$

and $r = W (\point \ominus \mu)$ is its *whitened residual*, a standard normal vector when
$\randomPoint$ is drawn from the normal.

> **Proposition (The normal's density).** Let $\manifold$ be a space of dimension $\dimension$ with a reference measure $\nu$, let
> $\mu \in \manifold$, let the chart at $\mu$ be global, with log-volume $\lambda_\mu$ and image
> $V_\mu$, and let $W$ be a lower-triangular $\dimension \times \dimension$ matrix with a positive
> diagonal. If $\zeta$ is a standard normal vector of $\R^\dimension$, then
> $\randomPoint = \mu \oplus W^{-1} \zeta$ has, with respect to $\nu$, the density
> $\exp \logterm_{\mathcal N}(\point;\, \mu, W)$ on $V_\mu$ and $0$ elsewhere, and its law is the
> normal distribution $\mathcal N(\mu, \Sigma)$ on $\manifold$ with $\Sigma = W^{-1} W^{-\top}$.

<Proof>

The vector $\varepsilon = W^{-1} \zeta = L \zeta$ is normal with mean zero and covariance
$L L\transpose = \Sigma$, so its density at $\tangent$ is $(2\pi)^{-\dimension/2} \det W
\exp(-\tfrac12 \lvert W \tangent \rvert^2)$, since $(\det \Sigma)^{-1/2} = \det W$ and
$\tangent\transpose \Sigma^{-1} \tangent = \lvert W \tangent \rvert^2$; its logarithm at $\tangent =
\point \ominus \mu$ is the first three terms of [](eq:term). The chart is global, so $\varepsilon \in
U_\mu$ always, and [%full](statement:math/chart-volume/pushforward) gives the density, which is
[](eq:archive/measures/math/chart-density) with that Gaussian as $f$.

</Proof>

So the term is the Gaussian log-density of the tangent coordinate, less the chart's log-volume
there, on every space alike. On a Euclidean space the log-volume is zero, and the normal is the
familiar one, with mean $\mu$ and covariance $\Sigma$. On a positive factor it is $J$ of
[](eq:jacobian), and the normal is the log-normal: $\log \randomPoint$ is normal with mean
$\log \mu$ and covariance $\Sigma$, so $\mu$ is the median of each coordinate rather than its mean,
which is $\mu_i e^{\Sigma_{ii} / 2}$. It is offered under the normal's name all the same: a model
that gives a positive quantity a normal has said how its noise acts, multiplicatively, through the
space's chart, and a second name would describe the same law twice. On a product the factors are
correlated through $\Sigma$ in their tangent coordinates, which is what a state with a position and
a positive scale, or a rotation and a position, needs. On a curved type the log-volume is the
type's declared one: $-2 \log(1 + \lvert \tangent \rvert^2 / 4)$ for the Cayley chart of the
rotations and the stereographic chart of the sphere [](eq:archive/measures/math/sphere-volume),
one scalar function of the residual that the Gaussian part already computes.

The log-volume is what keeps the term's density with respect to the type's reference measure. It
does not depend on the scale, so it changes no derivative with respect to it, but it is a function
of $\point$ and of $\mu$, and it is not a constant of a query that leaves either free. Without it,
three things the core relies on would fail: the sampler would not be exact for the term, so the
importance weight [](eq:archive/core/math/weight) would be wrong at every draw; the term would not
integrate to one; and a model mixing the normal with another distribution of the same quantity's
type would compare densities with respect to two different measures.

A measurement of a curved quantity is a normal with a computed mean:

$$
	z = h(\point) \oplus \varepsilon, \qquad \varepsilon \sim \mathcal N(0, \Sigma) \text{ on } \R^\dimension, @tag(measurement)
$$

that is, $z \sim \mathcal N(h(\point), \Sigma)$, scored by [](eq:term) at $\mu = h(\point)$. The
direction $u \in S^2$ to a landmark $\ell \in \R^3$ seen from a pose $(R, p)$, for one, has
$h(R, p) = R\transpose (\ell - p) / \lvert \ell - p \rvert$, a map into the sphere written in
storage and projected as [](eq:archive/core/math/map-into) allows.

### Why global charts

> [!DECISION] The normal requires a global chart
> On a type whose declared chart is full but not global, such as the exponential chart of the
> rotations, whose domain is the ball of radius $\pi$, the normal noise has mass $p > 0$ outside
> the domain, and no closed form makes both the density and the sampler exact. The draw $\mu \oplus
> \varepsilon$ wraps, and its law is within $p$ in total variation of the law the term
> describes ([%full](statement:math/chart-volume/local-chart)), but not equal to it. A draw
> repeated until the domain accepts it is exact for the term's normalized law, but the term then
> integrates to $1 - p$, whose logarithm has no closed form for a scale that is not isotropic. And
> the exact density of the wrapped law is a sum over every preimage of a point, an infinite series
> in every evaluation. The charter asks for a true density and an exact sampler, so the normal is
> defined on types whose chart is global, where both are exact at every scale, and a quantity of a
> type whose chart is not global is never scored by it.

The mass $p$ is small for concentrated noise: for an isotropic rotation's noise of standard
deviation $\sigma$, $p = \operatorname{erfc}(\pi / \sigma \sqrt 2) + \sqrt{2/\pi}\, (\pi / \sigma)\,
e^{-\pi^2 / 2 \sigma^2}$, the tail of a $\chi$ law with three degrees of freedom, which is
$1.4 \times 10^{-8}$ at $\sigma = 0.5$ rad and $0.02$ at $1$ rad. It is not zero, and the rule
costs little. A type that means to carry normals takes a global chart: for the rotations the
Cayley chart, the normalized first-order quaternion update $\mu \otimes (1, \tangent / 2)$, cheaper
than the exponential and with an inverse [](eq:math/chart-volume/cayley-inverse) free of
trigonometry; for the sphere the stereographic chart, which the core's acceptance-test sphere
already has. A type retracted by its exponential chart holds its measurements as likelihood factors
over data ([Without a volume or a global chart](#without-a-volume-or-a-global-chart)), as a type
without a volume does. A rigid motion held as a group, $SE(3)$ or $SE_2(3)$ rather than a rotation
and a position side by side, needs a global chart of its own, which is that type's entry to work
out.

## The scale

The term [](eq:term) reads the scale through $W$ alone, and $W$ enters linearly in the residual
and through the logarithms of its diagonal in the normalizer. A model gives the scale in whichever
form it has, and each form is a map to $W$ composed from the core's primitives, so that its
derivatives, of both orders, follow by composition:

| form | given | $W$ | $\sum_i \log W_{ii}$ |
| --- | --- | --- | --- |
| isotropic | $\sigma \in \positive$, with $\Sigma = \sigma^2 I$ | $\sigma^{-1} I$ | $-\dimension \log \sigma$ |
| diagonal | $\sigma \in \positive^\dimension$, with $\Sigma = \operatorname{diag}(\sigma)^2$ | $\operatorname{diag}(\sigma)^{-1}$ | $-\sum_i \log \sigma_i$ |
| covariance factor | $L$, with $\Sigma = L L\transpose$ | $L^{-1}$ | $-\sum_i \log L_{ii}$ |
| whitening | $W$, with $\Lambda = W\transpose W$ | $W$ | $\sum_i \log W_{ii}$ |

The first two are the forms most models write, a measurement's standard deviation or a motion
model's per-axis noise, and their whitened residual is the elementwise product of $\point \ominus
\mu$ with $\sigma^{-1}$, which the core composes as the reciprocal of a positive value read as a
real. The whitening is the form a precision arrives in: elimination produces information rather
than covariance, and a retirement's replacement is written in it (see
[As a likelihood factor](#as-a-likelihood-factor)). The residual is then the product $W (\point
\ominus \mu)$, and nothing is inverted. The covariance factor is the form a user with a full
covariance writes, and its residual is the solution $z$ of $L z = \point \ominus \mu$, by forward
substitution,

$$
	z_i = \frac{1}{L_{ii}} \Bigl( (\point \ominus \mu)_i - \sum_{j < i} L_{ij}\, z_j \Bigr),
	\qquad i = 1, \dots, \dimension, @tag(forward-substitution)
$$

a composite of $\dimension$ steps, each a sum of products and a multiplication by the reciprocal
of a positive diagonal entry. When $L$ is fixed in a query, $W = L^{-1}$ can instead be computed
once, column by column by the same substitution against the columns of the identity, and folded,
as the core folds every value reached only from fixed inputs; when $L$ is free, the residual is
solved on every evaluation, and its derivatives with respect to $L$ come with it.

**All four forms.** The normal offers all four, because each is the form some model has, and none
is reached from another without a computation the model did not ask for. The isotropic and
diagonal forms need no linear algebra at all. The whitening is what elimination and a retirement's
replacement produce, and inverting it to a covariance would cost a solve and lose the sparsity
elimination keeps. The covariance factor is what a user with a full covariance, from a datasheet
or a calibration, writes; it costs the substitution [](eq:forward-substitution), and a solve on
every evaluation when it is free, which is the price of not inverting a matrix the user has and
the term does not need inverted. Every form is a map to the same $W$, so the rest of this document
holds for each of them alike.

**A triangular factor as a quantity.** When a scale is to be estimated, its factor is a quantity,
and its type must have exactly as many tangent directions as the factor has free entries,
$\dimension (\dimension + 1) / 2$. A matrix $\R^{\dimension \times \dimension}$ would have
$\dimension (\dimension - 1) / 2$ more, along which the term does not change: the chart Hessian and
the expected information would be singular in them, and an estimator would have to know to ignore
them. The core already has the right type, a product
$\positive^\dimension \times \R^{\dimension (\dimension - 1) / 2}$ of the diagonal and the entries
strictly below it, in a fixed order. Its positive factor keeps the diagonal positive, so that the
factor is the unique Cholesky factor, its logarithms are defined, and no absolute value is needed,
which the core does not have. Its chart on the diagonal is logarithmic, so a tangent coordinate of
the diagonal is a relative change: these are the log-Cholesky coordinates of a covariance. For
$\dimension = 1$ the strictly lower part is empty and the factor is a positive scalar, the
isotropic form. The same type serves a covariance factor and a whitening, and a positive vector
serves a diagonal scale. A scale that is a quantity may have a normal of its own, on that type,
which is how a hierarchical model puts a prior on a noise.

## The sampler

The normal draws $\point = \mu \oplus L \zeta$, with $\zeta$ standard normal on
$\R^\dimension$. By [%full](statement:density), that draw has the density $\exp
\logterm_{\mathcal N}$, log-volume included, on every space the normal is defined on, so the
sampler is exact for the term [](eq:term) and contributes nothing to the importance weight. The
coordinates of $\zeta$ are drawn from the quantity's key as the core draws every variate (charter,
position 10): $\dimension$ uniform variates $u_i \in (0, 1)$, in double precision on the host, each
turned into $\zeta_i = \Phi^{-1}(u_i)$ by the standard normal quantile. A draw is then a
deterministic function of the key, smooth in $\mu$ and the scale, and the same key gives the same
draw at either precision, up to the rounding of the final cast.

Two computations in a draw are approximate, and neither is a matter of the model. The quantile
$\Phi^{-1}$ has no closed form; Wichura's algorithm AS 241, which the core's tests already use, is
a rational approximation in three pieces accurate to about $10^{-16}$ relative error, below the
rounding of double precision. And $L \zeta$ needs $L$, which the whitening form must invert: it is
the solution $y$ of $W y = \zeta$, found on the host, in double precision, by the substitution
[](eq:forward-substitution) with $W$ in place of $L$, as the charter has every solve run
(position 11). Inversion of the distribution function was chosen over
the Box–Muller transform because it spends exactly one uniform variate per coordinate, so that the
draw of coordinate $i$ depends on $u_i$ alone, and is monotone in it.

## Properties

The definition is short; what follows from it on a curved space is not, and none of it is a matter
of choice. Each property below holds of any normal pushed through a chart, and is stated here so
that a model's author knows what the parameters mean.

**The chart is part of the model.** The scale is read in the coordinates of the chart at $\mu$, so
two retractions of one space make two normals with the same $\mu$ and $\Sigma$, which agree only to
first order: the exponential and Cayley coordinates of a rotation by $\theta$ have the lengths
$\theta$ and $2 \tan(\theta/2) = \theta + \theta^3/12 + O(\theta^5)$. A covariance carried over
from a library that works in exponential coordinates is therefore, in the Cayley chart, a slightly
different model, indistinguishably so at the dispersions of most measurements. A type's normals are
part of what its retraction means, and changing the retraction of a type changes every model with
a normal on it. On a group, the side on which the retraction perturbs the point is part of it too,
in a way that can be undone exactly: the Cayley map satisfies
$\varphi(\operatorname{Ad}_g \tangent) = g\, \varphi(\tangent)\, g^{-1}$, so
$\mu\, \varphi(\tangent) = \varphi(\operatorname{Ad}_\mu \tangent)\, \mu$, and a normal with scale
$\Sigma$ in the point's own frame is the normal with $\operatorname{Ad}_\mu \Sigma
\operatorname{Ad}_\mu\transpose$ in a fixed frame of the world, with the same log-volume, which
depends on the rotation's angle alone.

**The basis on the sphere.** On the sphere the scale depends also on the basis $B(\mu)$ that
identifies the tangent plane with $\R^2$. No basis is smooth on all of $S^2$, so a field of bases
turns as $\mu$ moves in a way that the field, not the geometry, decides, and it spins near the
point where it fails, the south pole of the core's acceptance test. A scale that is not isotropic is
read along the basis's axes, and so means something different at every $\mu$. An isotropic scale is
free of the basis: with an orthonormal basis, the stereographic chart's $\lvert \point \ominus \mu
\rvert = 2 \tan(\alpha/2)$ depends only on the angle $\alpha$ between $\point$ and $\mu$.

**What the mean is.** The point $\mu$ is the centre of the chart in which the noise is normal. It is
not the expectation, which on an embedded type lies off the space; on the positive orthant it is
the median; and on a curved space it need not even be a mode. With the Cayley chart of the
rotations or the stereographic chart of the sphere and an isotropic scale $\sigma$, the density
along a ray from $\mu$ is proportional to $\exp(-r^2 / 2\sigma^2 + 2 \log(1 + r^2/4))$ in the
chart's radius $r$, whose logarithm has the second derivative $-1/\sigma^2 + 1$ at $r = 0$, so $\mu$
is a mode only when $\sigma < 1$ in the chart's coordinates. A broad normal piles its mass near the
half-turns or the antipode, where the chart compresses most.

**The estimate a measurement gives.** When $z$ is observed and the state $\point$ is free, the term
[](eq:term) at $\mu = h(\point)$ depends on $\point$ through the whitened residual and through
$\lambda_{h(\point)}(z \ominus h(\point))$. Near a zero residual, $-\lambda$ is $\lvert \tangent
\rvert^2 / 2$ to second order for the Cayley and stereographic charts, so the measurement weighs on
the state as a Gaussian of the residual would with the precision $\Lambda$ replaced by
$\Lambda - I$ on the rotation's or the direction's block. For a noise of $0.1$ rad that changes the
measurement's weight by $1\,\%$. Small, but it is the difference between the law [](eq:measurement)
and the law that least squares of the whitened residual estimates exactly, which
[Without a volume or a global chart](#without-a-volume-or-a-global-chart) describes.

**Derivatives.** Every step of [](eq:term) is an operation the core differentiates: the inverse
retraction, through the boundary operations of [%full](statement:archive/core/math/embedded) on an
embedded type; the whitening, as in [The scale](#the-scale); and the log-volume, as the type's
declared operation. The term's order is the least of theirs. On the flat-in-disguise spaces every
step, from the inverse retraction to the logarithms of the diagonal and the substitution
[](eq:forward-substitution), is a primitive of order two, so the term has order two; on a curved
type it has order two when the type's inverse retraction and log-volume admit Hessian passes.

## The expected information

An estimator that uses the expected information of the model in place of its Hessian, Fisher
scoring or a Riemannian sampler, asks of each term a matrix that is positive semidefinite by
construction. For the normal it has a closed form, which is exact on the flat-in-disguise spaces
and, on a curved space, exact in part and approximate in the rest, with its error stated.

> **Proposition (The normal's expected information).** Let $\randomPoint \sim \mathcal N(\mu, \Sigma)$ on a product $\manifold$ of Euclidean and positive
> factors, with $\Sigma^{-1} = \Lambda = W\transpose W$, and let the scale depend smoothly on
> coordinates $\theta \in \R^k$. The expected negative chart Hessian of
> $\logterm_{\mathcal N}(\point;\, \mu, W)$ over $(\point, \mu, \theta)$ is
>
> $$
> 	\mathcal I = \begin{pmatrix}
> 		\Lambda & -\Lambda & 0 \\
> 		-\Lambda & \Lambda & 0 \\
> 		0 & 0 & F
> 	\end{pmatrix},
> 	\qquad
> 	F_{ij} = \tfrac12 \operatorname{tr}\bigl(\Sigma\, \partial_i \Lambda\, \Sigma\, \partial_j \Lambda\bigr),
> $$
>
> and $F$ is the Fisher information of $\theta$. Every block is exact, at every $\mu$ and $\Sigma$.

<Proof>

By [](eq:translation), along $\point \oplus t \tangent$ and $\mu \oplus t u$ the tangent
$\varepsilon = \point \ominus \mu$ moves to $\varepsilon + t(\tangent - u)$ exactly, and $J$ moves
linearly, so the chart Hessian of [](eq:term) in $(\point, \mu)$ is that of
$\tfrac12 \varepsilon\transpose \Lambda \varepsilon$ in $\varepsilon$ composed with
$(\tangent, u) \mapsto \tangent - u$: the upper-left blocks of $\mathcal I$, at every point, before
any expectation. The mixed second derivative in $(\varepsilon, \theta_i)$ is
$\partial_i \Lambda\, \varepsilon$, whose expectation is zero since $\varepsilon$ has mean zero. In
$\theta$, the negative term is $\tfrac12 \varepsilon\transpose \Lambda \varepsilon - \tfrac12 \log
\det \Lambda$ plus what does not depend on $\theta$, since $\sum_i \log W_{ii} = \frac12 \log \det
\Lambda$. With $\partial_j \log \det \Lambda = \operatorname{tr}(\Sigma\, \partial_j \Lambda)$ and
$\partial_i \Sigma = -\Sigma\, \partial_i \Lambda\, \Sigma$, and $\E[\varepsilon
\varepsilon\transpose] = \Sigma$,

$$
	\E\Bigl[\partial_i \partial_j \bigl(\tfrac12 \varepsilon\transpose \Lambda \varepsilon - \tfrac12 \log \det \Lambda\bigr)\Bigr]
	= \tfrac12 \operatorname{tr}(\partial_i \partial_j \Lambda\, \Sigma)
	- \tfrac12 \operatorname{tr}(\partial_i \Sigma\, \partial_j \Lambda)
	- \tfrac12 \operatorname{tr}(\Sigma\, \partial_i \partial_j \Lambda)
	= \tfrac12 \operatorname{tr}(\Sigma\, \partial_i \Lambda\, \Sigma\, \partial_j \Lambda) .
$$

Neither the mean nor $J$ depends on $\theta$, so the score in $\theta$ is that of a centred normal,
and the expected negative Hessian equals its covariance, the Fisher information.

</Proof>

The archive's information was a matrix of the same blocks, but with $\pm I$ in place of the
derivatives of $\point \ominus \mu$, which on a group hold only at $\point = \mu$; it was therefore
correct to second order in the dispersion there. On the flat-in-disguise spaces
[](eq:translation) makes those derivatives exactly $\pm I$, and nothing is approximated.

**A root.** An estimator assembles the information of a model from roots of its terms', matrices
$C$ with $C\transpose C = \mathcal I$, composed with the Jacobians of the term's inputs with
respect to the free quantities. With $T_i = L\transpose\, \partial_i \Lambda\, L$, symmetric, the
trace is $\operatorname{tr}(\Sigma\, \partial_i \Lambda\, \Sigma\, \partial_j \Lambda) =
\operatorname{tr}(T_i T_j) = \sum_a (T_i)_{aa} (T_j)_{aa} + 2 \sum_{a > b} (T_i)_{ab} (T_j)_{ab}$,
so a root has $\dimension + \dimension (\dimension + 1) / 2$ rows,

$$
	C = \begin{pmatrix} W & -W & 0 \\ 0 & 0 & C_\theta \end{pmatrix},
	\qquad
	(C_\theta)_{(a, b),\, i} = \begin{cases} (T_i)_{aa} / \sqrt 2 & a = b, \\ (T_i)_{ab} & a > b, \end{cases} @tag(root)
$$

and $T_i$ in each form of the scale, with $E_{ab}$ the matrix unit and the diagonal entries
differentiated in their logarithmic charts, is

| form | coordinate | $T_i$ | $F$ |
| --- | --- | --- | --- |
| isotropic | $\log \sigma$ | $-2 I$ | $2 \dimension$ |
| diagonal | $\log \sigma_a$ | $-2 E_{aa}$ | $2 I$ |
| covariance factor | $L_{ab}$, $a > b$; $\log L_{aa}$ | $-(G + G\transpose)$, $G = W E_{ab}$; times $L_{aa}$ on the diagonal | $\frac12 \operatorname{tr}(T_i T_j)$ |
| whitening | $W_{ab}$, $a > b$; $\log W_{aa}$ | $G + G\transpose$, $G = E_{ab} L$; times $W_{aa}$ on the diagonal | $\frac12 \operatorname{tr}(T_i T_j)$ |

The rows for the covariance factor follow from $\partial \Lambda = -\Lambda\, \partial \Sigma\,
\Lambda$ and $\partial \Sigma = \partial L\, L\transpose + L\, \partial L\transpose$, those for the
whitening from $\partial \Lambda = \partial W\transpose W + W\transpose\, \partial W$, and the
logarithmic chart multiplies a diagonal column by the entry, by the derivative of the inclusion of
a positive value, $\operatorname{diag}(\point)$. The root of a scale given as a triangular factor
therefore needs both $W$ and $L$, whichever of them the model gives: the other is computed once and
folded when the scale is fixed, and by a solve [](eq:forward-substitution) on every evaluation when
it is free. This root is what the normal binds as the root of its expected information, among the
roles of [The roles](#the-roles), on every space.

**On a curved space.** The root [](eq:root) is then the same matrix, $\pm W$ in the blocks of
$\point$ and $\mu$, which are the derivatives of $\point \ominus \mu$ at a zero residual, and
$C_\theta$ in the scale's, and its accuracy is that of each block.

- *The scale's block is exact.* The chart is global, so the residual of a draw is exactly its
  noise, $(\mu \oplus \varepsilon) \ominus \mu = \varepsilon$ for every $\varepsilon$, of
  covariance $\Sigma$; neither $\mu$ nor $\lambda$ depends on the scale's coordinates $\theta$; and
  the computation of $F$ in the proof above holds unchanged.
- *The blocks of $\point$ and $\mu$ are exact at a zero residual, and of second order otherwise.*
  The derivatives of $\ominus$ differ from $\pm I$ by terms of first order in $\varepsilon$, whose
  expectation in a quadratic form is of second order since $\varepsilon$ is symmetric; the second
  derivatives of $\ominus$ meet the residual $\Lambda \varepsilon$, whose expectation is zero; and
  the Hessian of $\lambda$, $-I$ for the Cayley and stereographic charts, is of order $\Sigma$
  against $\Lambda$.
- *The mixed blocks, which the root sets to zero, are of first order.* On the rotations with the
  Cayley chart, the derivative of $\varepsilon = \point \ominus \mu$ along $\mu\, \varphi(s u)$ is
  $(-I + \tfrac12 [\varepsilon]_\times - \tfrac14 \varepsilon \varepsilon\transpose)\, u$, whose
  odd part is $\tfrac12 [\varepsilon]_\times u$, so the expected mixed second derivative of
  $-\logterm_{\mathcal N}$ along $u$ and $\theta_i$ is exactly
  $-\tfrac12 \operatorname{tr}(\Sigma\, \partial_i \Lambda\, [u]_\times)$. It is zero for every
  $u$ only when $\Sigma\, \partial_i \Lambda$ is symmetric, as for an isotropic or a diagonal
  scale, and otherwise it is a correlation between the mean and the scale of the order of the
  dispersion.

## As a likelihood factor

A likelihood factor scores no quantity, and so needs no measure: it is a function of the
quantities it is conditioned on. The normal's Gaussian part serves as one in two places.

**A retirement's replacement.** A retirement's replacement is a likelihood factor over the
quantities of its blanket $B$, scoring none of them ([the core's retirement](/archive/core/math.md#retirement)).
Under a Laplace approximation, and exactly for linear-Gaussian terms, it is a Gaussian function of
their tangent coordinates at an anchor: with constants $p_i$ for the blanket's quantities, the
stacked tangent

$$
	\delta(\point_B) = (\point_1 \ominus p_1;\ \dots;\ \point_k \ominus p_k) \in \R^D,
	\qquad D = \sum_i \dimension_i, @tag(stacked)
$$

and

$$
	\logterm_B(\point_B) = \logterm_{\mathcal N}\bigl(\delta(\point_B);\, m, W\bigr) + c , @tag(joint)
$$

the normal's term on $\R^D$, where the log-volume vanishes, at the mapped value $\delta$, with
mean $m$, whitening $W$ and a constant $c$. No new distribution is needed for it: it is the normal
on a Euclidean space evaluated at a value that is not a quantity, which scores nothing and so has
no sampler. The archive wrote its residual as $W\delta - b$, an offset form; that is [](eq:joint)
with $b = W m$, which the core folds when both are constants. The anchors must be constants, so
that the factor does not move with the quantities it summarizes. On a positive or a curved blanket
quantity $\delta$ reads its tangent coordinate at the anchor, and no log-volume is added: the
factor is a function of the quantities, not a density over them, and whatever measure the
approximated integral was taken in is already in its values. The log-volume enters where the
replacement is computed: a Laplace approximation of the integral over a retired quantity in its
chart at $\hat \point$ expands $\ell(\hat \point \oplus \tangent) + \lambda_{\hat \point}(\tangent)$
[](eq:archive/measures/math/chart-integral), so that the $W$ of a replacement over a curved blanket
quantity carries the log-volume's Hessian, $-I$ with the Cayley chart, before the factor is written.

The core's tests of retirement are of this form. The replacement
[](eq:archive/core/math/kalman) is [](eq:joint) with $k = 1$, the anchor $p_1 = a + K(\hat z_0 -
a)$ at that equation's updated mean, $m = 0$,
$W = (P + q^2)^{-1/2}$ and $c = \log \mathcal N(a, s^2 + r^2)(\hat z_0)$, and
[](eq:archive/core/math/joint-blanket) is [](eq:joint) with $k = 2$, both anchors at $a$, $m = 0$,
$c = 0$, and $W$ the whitening of its $2 \times 2$ covariance. With the normal in the library,
both can be written with it rather than by hand.

**The stacked tangent.** This entry provides the replacement's form as a convenience, so that
neither a test nor the elimination entry that will compute replacements writes it by hand. It is
given the blanket's continuous quantities in an order, an anchor for each, a mean $m \in \R^D$, a
scale in any of the forms of [The scale](#the-scale) of dimension $D$, and a constant $c$, and it
adds the likelihood factor [](eq:joint) at the mapped value $\delta$ of [](eq:stacked), its blocks
in the order given. Three conditions make that factor the one a replacement means.

- *The anchors are constants*, of the types of their quantities, since a replacement summarizes
  the retired terms at fixed points and must not move with the quantities it is a function of; an
  anchor reached from a quantity is refused.
- *The quantities are continuous*, since $\delta$ is made of tangent coordinates; a discrete
  quantity of a blanket is summarized, if at all, by a factor of another form.
- *$\point_i \ominus p_i$ is defined* where the factor is evaluated: on the chart's image
  $V_{p_i}$, which for a full chart is all of the type but a set of measure zero, so that a
  replacement over a curved quantity is read in the chart in which it was computed. The type need not have a volume, nor a global chart,
  since the factor scores nothing.

Its derivatives are those of its parts: the block of $\delta$ for the quantity $\point_i$ has the
derivative $\D(\point_i \ominus p_i)$ in the chart at $\point_i$, which is the identity at
$\point_i = p_i$ and everywhere on a flat-in-disguise type by [](eq:translation), and on a curved
type moves with $\point_i$ as the core's inverse retraction does. It binds the roles of a
likelihood factor ([The roles](#the-roles)): its whitened residual $W(\delta - m)$, its mean $m$ and
its scale.

### Without a volume or a global chart

A type that declares no volume has no densities, and the core refuses a term that scores one of its
quantities ([Types without a volume](/archive/measures/math.md#types-without-a-volume)); a type whose
chart is not global has densities, but no normal. Either can still carry a measurement, as a
likelihood factor over data: with $z$ a constant, the measured value, the Gaussian part
$-\tfrac12 \lvert W (z \ominus h(\point)) \rvert^2$ is a function of $\point$ that scores nothing.
It is not the log-likelihood of the law [](eq:measurement), from which it lacks $\lambda$, a
function of $\point$. It is, exactly, the log-likelihood of another law.

> **Proposition (The normalizer of a translated chart).** Let $G$ be a Lie group with a Haar measure $\nu$ and the retraction $R_\mu(\tangent) = \mu\,
> \varphi(\tangent)$ of [%full](statement:math/chart-volume/group), whose chart is full, and let $W$
> be fixed. Then
>
> $$
> 	Z(\mu) = \int_{V_\mu} \exp\bigl(-\tfrac12 \lvert W (z \ominus \mu) \rvert^2\bigr) \, \dd \nu(z)
> 	= \int_U \exp\bigl(-\tfrac12 \lvert W \tangent \rvert^2\bigr)\, v_e(\tangent) \, \dd \tangent
> $$
>
> does not depend on $\mu$.

<Proof>

Substitute $z = \mu g$. The measure $\nu$ is invariant under left translation, $V_\mu = \mu V_e$,
and $z \ominus \mu = \varphi^{-1}(\mu^{-1} z) = g \ominus e$, so $Z(\mu) = Z(e)$. The second form
is [](eq:math/chart-volume/image) at $e$, with $g(\tangent) = \exp(-\tfrac12 \lvert W \tangent
\rvert^2)$.

</Proof>

So on a group whose chart translates one of the identity, the exponential chart of the rotations
among them, $\exp(-\tfrac12 \lvert W (z \ominus \mu) \rvert^2) / Z$ is a density of $z$ with respect
to Haar measure for every $\mu$, its log-likelihood in $\mu$ is the Gaussian part up to a constant,
and least squares of the whitened residual is exact maximum likelihood for it. This is the model
that factor-graph libraries estimate. Its $z$ is not $\mu \oplus \varepsilon$ for a normal
$\varepsilon$, so it has no sampler of that form, and $Z$ has no closed form, so the factor is a
likelihood only for a fixed scale. On the sphere the same holds for an isotropic scale with a chart
whose residual's length depends only on the angle to $\mu$. Such a measurement is a constant, not
a quantity: it can be conditioned on but not simulated, and a query cannot leave it free.

## The roles

The charter has a distribution declare, as its term is added, the nodes that readers other than the
model's density need, each under a *role*, and has each role arrive with the distribution or reader
that gives it meaning ([position 8](/archive/charter/writeup.md)). No reader of the normal's roles exists
yet: the least-squares readers and Fisher scoring are entries of their own. The normal binds them
all the same, so that those readers find them waiting rather than revising this entry, and so that
the mathematics of each binding, which is the distribution's to settle, is settled here.

| role | multiplicity | the node it binds |
| --- | --- | --- |
| whitened residual | exactly one | $r = W (\point \ominus \mu) \in \R^\dimension$, computed as the form of the scale computes it |
| mean | exactly one | $\mu$ |
| scale | exactly one | the scale as the model gives it, $\sigma$, $\sigma$, $L$ or $W$, together with its form |
| log-volume | at most one | $\lambda_\mu(\point \ominus \mu)$, where it is not identically zero |
| information root | at most one | the root $C$ of [](eq:root) |

The charter's example binds a covariance factor. With four forms of the scale, the role binds
whichever the model gave, and its form, from which a reader computes $W$ or $L$ as
[The scale](#the-scale) says; in the covariance factor's form the residual is the solution $z$ of
[](eq:forward-substitution), which is $W (\point \ominus \mu)$ without $W$ ever being formed.

**What a reader of the residual estimates.** The term is $-\tfrac12 \lvert r \rvert^2$ plus a
normalizer in the scale, less the log-volume. A least-squares reader that minimizes
$\tfrac12 \lvert r \rvert^2$ over the free quantities, with the scale fixed, therefore maximizes the
term itself only where the log-volume is constant in them. On a Euclidean space it is zero. On a
positive factor it is $J(\point)$, constant when $\point$ is observed, and not when $\point$ is
free, where ignoring it finds the mode in the logarithmic chart rather than with respect to Lebesgue
measure. On a curved space it is $\lambda_\mu(\point \ominus \mu)$, which moves with the mean, so
that a measurement's estimate of the state differs by the precision change of
[Properties](#properties). The log-volume's role is what lets a reader add its gradient and
Hessian, and so estimate the normal's own mode; a reader that ignores it estimates, on a group, the
law of [%full](statement:invariant), the model of factor-graph libraries, and should say so.

**Gauss–Newton with a log-volume.** A model of normals with fixed scales, every free quantity $q$
taken together as a point of the product of their types, has the negative log-density

$$
	f(q) = \tfrac12 \sum_i \lvert r_i(q) \rvert^2 + s(q), \qquad s(q) = \sum_i \lambda_{\mu_i}(t_i), \quad t_i = \point_i \ominus \mu_i , @tag(gn-objective)
$$

up to a constant, the sums over the terms, each with its residual $r_i = W_i t_i$. The log-volumes
are not squares, and cannot be made into squares: near $t = 0$ they are concave, $-\lvert t
\rvert^2 / 2$ for the Cayley and stereographic charts, since the chart compresses volume away from
its centre. A reader that accepts only residuals has nothing to do with them. A Gauss–Newton reader
that takes the log-volume's role as well loses nothing by it.

> **Proposition (Gauss–Newton with a scalar term).** Let $\manifold$ be a manifold with a retraction, $f(q) = \tfrac12 \lvert r(q) \rvert^2 + s(q)$ with
> $r : \manifold \to \R^m$ and $s : \manifold \to \R$ smooth, and $J(q) = \D r(q)$ and
> $g(q) = J\transpose r + \D s\transpose$ the Jacobian of $r$ and the gradient of $f$ in the chart at
> $q$. Let the iteration be
>
> $$
> 	q_{k+1} = q_k \oplus \delta_k, \qquad J\transpose J\, \delta_k = -g(q_k) ,
> $$
>
> with $J\transpose J$ invertible near the iterates. Then $\delta_k = 0$ if and only if $q_k$ is a
> stationary point of $f$. If $q^*$ is a stationary point, $H^*$ the chart Hessian of $f$ there and
> $E = H^* - J\transpose J$ at $q^*$, and the spectral radius $\rho$ of $(J\transpose J)^{-1} E$ is
> less than $1$, then the iteration converges to $q^*$ from every start near enough to it, and
> $\limsup_k \lvert q_{k+1} \ominus q^* \rvert / \lvert q_k \ominus q^* \rvert \le \rho$ in any norm
> for which the spectral radius is attained.

<Proof>

The matrix $J\transpose J$ is invertible, so $\delta_k = 0$ exactly when $g(q_k) = 0$. Read the
iteration in the chart at $q^*$ as the map $\Phi(q) = q \oplus \bigl(-(J\transpose J)^{-1}
g(q)\bigr)$. At $q^*$, $g = 0$, so the derivative of $\Phi$ there is
$I - (J\transpose J)^{-1} \D g(q^*)$, the derivative of the retraction in its tangent argument
being the identity at $0$. At a stationary point the derivative of the chart gradient is the chart
Hessian, the correction term of [%full](statement:math/derivatives-in-charts/chart-hessian)
vanishing with the gradient, so $\D \Phi(q^*) = I - (J\transpose J)^{-1} H^* =
-(J\transpose J)^{-1} E$. A fixed point of a smooth map whose derivative has spectral radius
$\rho < 1$ attracts every start near enough to it, at the linear rate $\rho$ (Ostrowski's theorem).

</Proof>

Three consequences follow for a reader of the roles.

- **The answer depends on the gradient alone.** Whatever matrix stands on the left, the
  iteration stops where $g = 0$, so a reader that adds the log-volume's gradient to $g$ converges
  to the mode of [](eq:gn-objective), the model's own, and one that leaves it out converges to the
  mode of the factor-graph model. The sparsity of $J\transpose J$ is unchanged, since each
  $\lambda_{\mu_i}$ depends on the quantities its own residual already touches.
- **Leaving its Hessian out costs little.** In $E$ the log-volumes contribute $\D^2 s = \sum_i
  A_i\transpose \nabla^2 \lambda_i\, A_i$, with $A_i = \D t_i$, besides terms in $\nabla
  \lambda_i$ that vanish at $t_i = 0$ and are of the order of the residual-curvature terms below,
  while $J\transpose J = \sum_i A_i\transpose \Lambda_i A_i$. If $-\kappa \Lambda_i \preceq
  \nabla^2 \lambda_i \preceq \kappa \Lambda_i$ for every term, then $-\kappa J\transpose J \preceq
  \D^2 s \preceq \kappa J\transpose J$, and the log-volumes add at most $\kappa$ to $\rho$, with
  $\kappa = \max_i \lvert \Sigma_i^{1/2} \nabla^2 \lambda_i\, \Sigma_i^{1/2} \rvert$. Near
  $t = 0$ that is $\sigma^2$ for the Cayley and stereographic charts, $\sigma^2$ the largest
  variance of a rotation's or a direction's noise: $0.01$ per iteration at $\sigma = 0.1$ rad. The
  rest of $E$ is $\sum_i \sum_k (r_i)_k \nabla^2 (r_i)_k$, which every Gauss–Newton method omits,
  and which on a curved space includes the second derivatives of $\ominus$, of the same relative
  order $\sigma^2$: the log-volume does not change the order of the approximation. A free positive
  quantity adds nothing at all to $E$, its log-volume $J(\point)$ being linear in its chart.
- **Adding its Hessian is safe where a Gaussian approximation is.** When $\kappa < 1$,
  $J\transpose J + \D^2 s \succeq (1 - \kappa)\, J\transpose J$ is positive definite, so a reader
  may use it as the matrix, and converge faster. The condition $\kappa < 1$ is, term by term, the
  one under which [Properties](#properties) found $\mu$ a mode at all, $\sigma < 1$ in the chart's
  coordinates. Where it fails, the posterior is not concentrated around one mode, and no method of
  this kind fits it. The covariance $(J\transpose J)^{-1}$ that a Laplace approximation reads off
  the Gauss–Newton matrix is then smaller than $(J\transpose J + \D^2 s)^{-1}$, by a relative
  $\kappa$ at most, since $\D^2 s \preceq 0$ for these charts: the volume makes the posterior a
  little broader than the squares alone say.

**The information root.** The role binds the matrix $C$ of [](eq:root), of
$\dimension + \dimension(\dimension+1)/2$ rows, whose three block columns a reader composes with
the Jacobians, with respect to the free quantities, of $\point$, of $\mu$ and of the scale's
coordinates $\theta$. When the scale is a constant there is no $\theta$, and the root is its first
block row, $(W \;\, -W)$. On the flat-in-disguise spaces the root is exact by
[%full](statement:information); on a curved space its accuracy, block by block, is the one
[On a curved space](#the-expected-information) states.

**Likelihood factors.** A likelihood factor in the forms of this document, a retirement's
replacement [](eq:joint) or a measurement over data, binds the whitened residual, the mean and the
scale, and binds no information root: the expected information is an expectation over the quantity
a term scores, and a likelihood factor scores none. A reader that needs a positive semidefinite
matrix from one has it in the Gauss–Newton product of its residual's Jacobian, which the residual's
role gives, and which for the replacement [](eq:joint), a Gaussian of $\delta$, is its negative
Hessian in $\delta$.

## What the tests check

The mathematics above is checked on the spaces the library has. It has no curved type yet, but the
core's tests have two spheres with declared volumes, written against its public interface alone:
the acceptance-test sphere, whose stereographic chart is global and full, of log-volume
[](eq:archive/measures/math/sphere-volume) against surface measure, and an exponential sphere whose
chart is full but not global. The normal is tested on the flat-in-disguise spaces and on the
stereographic sphere, where its density and sampler are exact, and the exponential sphere serves
only to show that a type whose chart is not global is refused. A rotation group, and the Cayley
chart's figures of [Properties](#properties) and [On a curved space](#the-expected-information),
are left to the entry that brings it.

- **The density integrates to one**, against the reference measure: by quadrature in the tangent
  coordinate on $\R$ and $\positive$, and on the sphere through its chart,
  $\int_{\R^2} \exp\bigl(\logterm_{\mathcal N}(\mu \oplus \tangent;\, \mu, W) + \lambda_\mu(\tangent)
  \bigr)\, \dd \tangent = 1$ by [](eq:math/chart-volume/image), for an isotropic and an anisotropic
  scale, and at a $\mu$ near the basis's failure as well as far from it.
- **The sampler is exact for the term**: the empirical law of $\mu \oplus L \zeta$ over many keys
  agrees with expectations computed by quadrature against $\exp \logterm_{\mathcal N}$, on each of
  those spaces and in each form of the scale, and on the positive orthant $\log \randomPoint$ has
  mean $\log \mu$ and covariance $\Sigma$.
- **The term is [](eq:term) on the flat-in-disguise spaces**, with $J$ of [](eq:jacobian) on a
  positive factor, and on the sphere its log-volume is the declared one.
- **The forms of the scale agree**: the four forms of one $\Sigma$ give one term, one residual, one
  sampler and one root, the covariance factor's residual by [](eq:forward-substitution).
- **The information is as stated**: on the flat-in-disguise spaces the root [](eq:root) satisfies
  $C\transpose C = \mathcal I$ against the expected negative chart Hessian, estimated over draws,
  of [%full](statement:information); on the sphere the scale's block agrees with $F$ and the
  blocks of $\point$ and $\mu$ agree with $\pm \Lambda$ to second order in the scale.
- **The roles are bound** as [The roles](#the-roles) lists them, the log-volume only where it is
  not zero, and a Gauss–Newton iteration with the log-volume's gradient converges to the mode of
  [](eq:gn-objective), and without it to the mode of the residuals alone, as
  [%full](statement:gauss-newton) says.
- **The stacked tangent** reproduces the core's replacements [](eq:archive/core/math/kalman) and
  [](eq:archive/core/math/joint-blanket), refuses an anchor that is not a constant and a discrete
  quantity, and works on the sphere, which a likelihood factor needs no volume for.
- **What the normal refuses**: a quantity of the exponential sphere, whose chart is not global, and
  of a type without a volume; such a quantity's measurement is accepted as a likelihood factor over
  data.

## In skoro's terms

- **The normal scores one quantity** $\point$, of any continuous type with a volume whose chart is
  global: the core's own types, embedded types that declare a global chart, and products of these.
  On the core's types it is the familiar normal, and on a positive factor the log-normal, under the
  same name. A quantity of a type without a volume, or whose chart is not global, is never scored
  by it.
- **Its term** [](eq:term) is a composite of the core's operations and the type's log-volume,
  conditioned on the quantities its mean and scale are reached from, which may be constants,
  quantities or mapped values of any kind the core allows. Its mean is any value of the scored
  quantity's type, a mapped value $h(\point)$ of the state among them. Its log-density is with
  respect to the type's reference measure, exactly.
- **A measurement** [](eq:measurement) is such a quantity, held as what was measured rather than as
  a residual: observed in a query that has the measurement, and free, to be drawn, in one that
  simulates it. States, measurements and scales alike may be quantities with normals, which is how
  a hierarchical model is built forward.
- **Its derivatives** with respect to $\point$, to $\mu$ and to the scale, of first and second
  order, are those of the composite, of order two on the core's types and on a curved type whose
  inverse retraction and log-volume admit Hessian passes.
- **Its scale** is given in any of the four forms of [The scale](#the-scale), all of which it
  offers: positive values for the isotropic and diagonal forms, and the product
  $\positive^\dimension \times \R^{\dimension(\dimension-1)/2}$ for a triangular factor when it is a
  quantity. A fixed scale's whitening and normalizer are folded, in the model when it is a constant
  and in a compiled query when it is observed.
- **Its sampler is exact**, drawing $\mu \oplus L \Phi^{-1}(u)$ from the variates of the
  quantity's key, on the host in double precision, smooth in $\mu$ and the scale.
- **Its expected information** over $(\point, \mu, \theta)$ has the root [](eq:root): exact on the
  core's types, and on a curved type exact in the scale's block, of second order in the blocks of
  $\point$ and $\mu$, and of first order in the mixed block it omits.
- **Its roles**, bound as its term is added though no reader uses them yet, are its whitened
  residual, its mean, its scale with its form, its log-volume where it is not zero, and the root
  [](eq:root) of its expected information ([The roles](#the-roles)).
- **As a likelihood factor**, its Gaussian part on $\R^D$ evaluated at the stacked tangent
  [](eq:stacked) of a blanket's continuous quantities at constant anchors is the form of a
  retirement's Gaussian replacement, which this entry provides as a convenience
  ([The stacked tangent](#as-a-likelihood-factor)); and at a constant measured value it carries a
  measurement on a type without a volume or a global chart, which with a fixed scale is the exact log-likelihood of the law of
  [%full](statement:invariant).

## Open questions

None remain.
