---
title: The normal distribution in a chart
part: probability
order: 3
summary: The normal on a manifold with a global chart is the law of a point moved from its mean by Gaussian noise through the chart; its density is the Gaussian's less the chart's log-volume, its sampler is exact, and its expected information has a closed form, exact on flat and positive spaces and in the scale's block on curved ones.
depends_on: [generative-models, chart-volume, derivatives-in-charts]
---

# The normal distribution in a chart

On $\R^\dimension$ the normal distribution is the law of $\mu + \varepsilon$, a mean moved by Gaussian noise.
A curved space has no addition, but it has a [retraction](/math/retraction.md), and the same sentence defines a normal on it: the law of $\mu \oplus \varepsilon$.
This note takes that definition seriously.
It gives the density, which carries the [volume of the chart](/math/chart-volume.md), the forms a scale is given in, the sampler, what the mean and the scale mean once the space is curved, and the expected information that estimators ask of a distribution.

## The definition

Let $\manifold$ be a manifold of dimension $\dimension$ with a retraction and a reference measure $\nu$, whose chart at every $\mu$ is *global*, defined and invertible on all of $\R^\dimension$, with image $V_\mu$ and log-volume $\lambda_\mu$.
Such spaces include $\R^n$ and the positive orthant $\positive^n$ with Lebesgue measure, the rotations with the Cayley chart, the sphere with the stereographic chart, and products of these with the product measure.

The normal's *mean* is a point $\mu \in \manifold$.
Its *scale* is a symmetric positive definite $\dimension \times \dimension$ matrix $\Sigma$, read 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$: $L$ is the Cholesky factor of $\Sigma$, and both are unique.

The normal $\mathcal N(\mu, \Sigma)$ on $\manifold$ is the law of $\mu \oplus \varepsilon$, where $\varepsilon$ is normal on $\R^\dimension$ with mean zero and covariance $\Sigma$.
Its log-density 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(log-density)
$$

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 manifold of dimension $\dimension$ with a retraction and 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:log-density).
The chart is global, so $\varepsilon$ lies in its domain always, and [%full](statement:math/chart-volume/pushforward) gives the density.

</Proof>

So the log-density 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 the log-volume is $\sum_i \log \point_i$, 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 and not its mean, which is $\mu_i e^{\Sigma_{ii} / 2}$.
  The noise acts multiplicatively, through the space's chart.
- 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 space the log-volume is the chart's: $-2 \log(1 + \lvert \tangent \rvert^2 / 4)$ for the Cayley chart of the rotations and the stereographic chart of the sphere, one scalar function of the residual that the Gaussian part already computes.

The log-volume is what makes [](eq:log-density) a density with respect to the space's reference measure.
It does not depend on the scale, but it is a function of $\point$ and of $\mu$.
Without it the function would not integrate to one, it would not be the density of what the sampler draws, and it could not be compared with another distribution's density on the same space, taken against the same measure.

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)$, with the log-density [](eq:log-density) 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$.

## Why the chart must be global

On a space whose chart is full but not global, such as the rotations with their exponential chart, whose domain is the ball of radius $\pi$, Gaussian 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 that the single term of [](eq:log-density) describes ([%full](statement:math/chart-volume/local-chart)), but is not equal to it.
A draw repeated until the domain accepts it is exact for the normalized law, but the density 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 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.
With a global chart the density and the sampler are both exact at every scale, and that is the case this note treats.
[The last section](#the-gaussian-part-alone) says what the Gaussian part alone is on a space without one.

## The scale

The log-density reads the scale through $W$ alone: linearly in the residual, and through the logarithms of its diagonal in the normalizer.
A scale is given in whichever form is at hand, and each form is a map to $W$.

| 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 need no linear algebra: their whitened residual is the elementwise product of $\point \ominus \mu$ with $\sigma^{-1}$.
The whitening is the form a precision arrives in, since [elimination](/math/square-root-elimination.md) produces information and not covariance, and its residual is the product $W (\point \ominus \mu)$, with nothing inverted.
The covariance factor is the form of a full covariance from a datasheet or a calibration, 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)
$$

which never forms the inverse of a matrix the density does not need inverted.

When a scale is itself estimated, its factor is a point of a space, and the space should have exactly as many tangent directions as the factor has free entries, $\dimension (\dimension + 1) / 2$.
The square matrices have $\dimension (\dimension - 1) / 2$ more, along which the density does not change, and its Hessian and its expected information would be singular in them.
The right space is the product $\positive^\dimension \times \R^{\dimension (\dimension - 1) / 2}$ of the diagonal and the entries strictly below it.
Its positive factor keeps the diagonal positive, so that the factor is the unique Cholesky factor and its logarithms are defined, and 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.
A scale in them may have a normal of its own, on that space, 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) the draw has exactly the density [](eq:log-density), log-volume included, on every space the normal is defined on.

The coordinates of $\zeta$ are made from uniform variates $u_i \in (0, 1)$ by the standard normal quantile, $\zeta_i = \Phi^{-1}(u_i)$.
Inversion of the distribution function spends exactly one uniform variate per coordinate, so that the draw of coordinate $i$ depends on $u_i$ alone and is monotone in it, which the Box–Muller transform does not offer.
The draw is then a deterministic function of the variates, smooth in $\mu$ and in the scale.
The whitening form needs $L \zeta$ without $L$: it is the solution $y$ of $W y = \zeta$, by the substitution [](eq:forward-substitution) with $W$ in place of $L$.

## What the parameters mean

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.

**The chart is part of the distribution.**
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 stated in exponential coordinates is, in the Cayley chart, a slightly different distribution, indistinguishably so at the dispersions of most measurements.
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: by [](eq:math/rotations/conjugation), a normal with scale $\Sigma$ in the point's own frame is the normal with $\pi(\mu)\, \Sigma\, \pi(\mu)\transpose$ in the outer frame, 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.
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 a curved space embedded in a vector space 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.
With the stereographic chart of the unit quaternions, whose log-volume is $-3 \log(1 + r^2 / 16)$, the condition is $\sigma^2 < \tfrac83$.
A broad normal piles its mass where the chart compresses most, near the half-turns or the antipode, and is no way of saying that a rotation is unknown.

**The estimate a measurement gives.**
When $z$ is observed and $\point$ is to be estimated, the log-density [](eq:log-density) 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 $\point$ 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\,\%$.
It is small, and it is the difference between the law [](eq:measurement) and the law that least squares of the whitened residual estimates exactly, which [the last section](#the-gaussian-part-alone) describes.

## The expected information

An estimator that uses the expected information of a distribution in place of its Hessian, as Fisher scoring does, asks for a matrix that is positive semidefinite by construction.
For the normal it has a closed form.
It is exact on the spaces where the chart acts as a translation, and on a curved space it is exact in part and approximate in the rest, with its error known.

Call a product of Euclidean and positive factors *flat in disguise*.
On such a space, for any $\mu$, $\point \mapsto \point \ominus \mu$ is a diffeomorphism 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.
Its log-volume at the coordinate of a point is $J(\point) = \sum_i \log \point_i$ over the positive coordinates, a function of the point alone.

> **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{bmatrix}
> 		\Lambda & -\Lambda & 0 \\
> 		-\Lambda & \Lambda & 0 \\
> 		0 & 0 & F
> 	\end{bmatrix},
> 	\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:log-density) 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 log-density 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$,

$$
	\begin{aligned}
		\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) .
	\end{aligned}
$$

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>

**A root.**
Information is assembled from roots, matrices $C$ with $C\transpose C = \mathcal I$, composed with the Jacobians of the distribution's arguments.
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{bmatrix} W & -W & 0 \\ 0 & 0 & C_\theta \end{bmatrix},
	\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.
The root of a scale given as a triangular factor therefore needs both $W$ and $L$, whichever of them is given.

**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 a step $s u$ of $\mu$ 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.

## The Gaussian part alone

Estimation on curved spaces is often done with the Gaussian part alone: the sum of squares $-\tfrac12 \lvert W (z \ominus h(\point)) \rvert^2$ of the whitened residual, with no log-volume.
That 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, and it is available where the normal is not, on a space whose chart is not global.

> **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.
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 it 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$.
A measurement under this law can be conditioned on and cannot be simulated: it is a [likelihood factor](/math/generative-models.md#conditioning-and-likelihoods) over data, and not a quantity of the model.
