skoro v0.0.0

Models built forward, for the measure theorist

Why an abstract probability space serves modelling as an abstract vector space serves linear algebra, why the way back to coordinates is harder in probability, and how building a model forward from densities restores it, so that every random variable factors through the quantities and every expectation is an explicit integral.

Updated 2026-11-25 · 17 min read

This note is for the reader who knows measure theory far better than statistics, and who wants to know what a probabilistic model is before being told how to compute with one. Its argument is an analogy with linear algebra, and its conclusion is that models built forward from densities sit in a corner of probability theory where the analogy is exact: one can reason abstractly and compute concretely, and move between the two without meeting the edge cases that usually make the move painful.

The abstraction, and the way back#

Linear algebra is done in an abstract vector space VV. A mathematician working there never says which coordinate of which Rd\R^\dimension holds which quantity of interest: vectors are added, subspaces W⊆VW \subseteq V are taken, linear maps are composed, and the dimension can be anything. When a computation is needed, a basis is chosen, VV becomes Rd\R^\dimension, and the abstract statements become statements about arrays of numbers. The way back is a single theorem: every finite-dimensional vector space is isomorphic to a coordinate space, and every choice of basis gives such an isomorphism.

Probability is done in an abstract probability space (Ω,F,P)(\Omega, \scrF, \rmP). A modeller working there never says what Ω\Omega is, nor which sets are in F\scrF, nor what P\rmP assigns to them. Instead they introduce random variables x:Ω→X\randomPoint : \Omega \to \manifold, measurable maps into the spaces where the quantities of the model live, and speak only of those: their laws, their joint laws, the independence of one from another, the conditional law of one given another. Any number of them may be introduced, and new ones may be introduced later, provided the space is rich enough to carry them. The abstraction does for the modeller what VV does for the linear algebraist: it relieves them of a coordinate system they do not need.

The way back to coordinates is where the analogy usually breaks. Several things can go wrong at once:

  • The space is underdetermined. Many triples (Ω,F,P)(\Omega, \scrF, \rmP) carry random variables with the same joint law, and F\scrF may hold far more than the model ever mentions. Nothing in the model says which.

  • Conditioning needs regularity. The conditional law of x\randomPoint given y\otherRandomPoint, for x\randomPoint with values in (X,X)(\manifold, \scrX) and y\otherRandomPoint in (Y,Y)(\otherManifold, \scrY), defined as a kernel Px∣y:X×Y→[0,1]\rmP_{\randomPoint \mid \otherRandomPoint} : \scrX \times \otherManifold \to [0, 1], written Px∣y(A∣y)\rmP_{\randomPoint \mid \otherRandomPoint}(A \mid \otherPoint) and characterized by

    P(x∈A, y∈B)=∫BPx∣y(A∣y) P(y∈dy)for all A∈X, B∈Y,(1) \rmP(\randomPoint \in A,\ \otherRandomPoint \in B) = \int_B \rmP_{\randomPoint \mid \otherRandomPoint}(A \mid \otherPoint)\, \rmP(\otherRandomPoint \in \dd\otherPoint) \qquad \text{for all } A \in \scrX,\ B \in \scrY, \tag{1}
    (1)

    a regular conditional distribution, exists only under assumptions on the spaces (standard Borel is the usual one), and even then only up to null sets of y\otherRandomPoint’s law. Conditioning on an event of probability zero, which is what observing a continuous quantity does, depends on which version is chosen; the Borel–Kolmogorov paradox is the classic example of two natural versions disagreeing.

  • Densities need a reference. A density is a Radon–Nikodym derivative, and exists only when the law is absolutely continuous with respect to a chosen measure. The law of a function of quantities, such as (x,x)(\randomPoint, \randomPoint) or a projection, often has none.

  • Existence needs a theorem. Writing down a family of random variables does not make a space that carries them. Kolmogorov’s extension theorem builds one from consistent finite-dimensional laws, but asks for topological regularity of the spaces to do so.

So the modeller who wants to compute, to write a probability as an integral and evaluate it, has to justify every step back from (Ω,F,P)(\Omega, \scrF, \rmP), and usually does not.

A corner of probability where the way back is clean#

Applied models are almost never as general as the theory allows. They are built from two ingredients, and both remove an edge case.

Seeds with densities. Every quantity lives in a space with a reference measure, a σ\sigma-finite measure against which its distributions are written as functions. The two examples to keep in mind are Lebesgue measure on Rd\R^\dimension (or an open subset of it, such as the positive orthant) and counting measure on a countable set, which may itself sit inside a vector space, such as the integers. Every distribution a quantity is drawn from is absolutely continuous with respect to its reference measure, so it is given by a function.

Theorem 2(Radon–Nikodym).

Let ν\nu be a σ\sigma-finite measure on a measurable space (X,X)(\manifold, \scrX), and μ\mu a finite measure on it with μ≪ν\mu \ll \nu, that is, ν(A)=0\nu(A) = 0 implies μ(A)=0\mu(A) = 0. Then there is a measurable p:X→[0,∞)\density : \manifold \to [0, \infty) with

μ(A)=∫Ap dνfor every A∈X, \mu(A) = \int_A \density \,\dd\nu \qquad \text{for every } A \in \scrX,

and any two such functions agree ν\nu-almost everywhere. One writes p=dμ/dν\density = \dd\mu / \dd\nu and μ(dx)=p(x) ν(dx)\mu(\dd\point) = \density(\point)\, \nu(\dd\point).

With respect to Lebesgue measure, p\density is a probability density function: μ(dx)=p(x) dx\mu(\dd\point) = \density(\point)\, \dd\point, its values are not probabilities, every single point has measure zero, and p\density is determined only up to a Lebesgue-null set. With respect to counting measure, nothing is null but the empty set, and the density is pinned down completely by the mass it gives to points.

Proposition 3(A mass function is its measure on points).

Let X={x0,x1,… }\manifold = \{\point_0, \point_1, \dots\} be countable, with every subset measurable, and let ν=∑kδxk\nu = \sum_k \delta_{\point_k} be counting measure. Every probability measure μ\mu on X\manifold is absolutely continuous with respect to ν\nu, its density is unique, and it is

p(xk)=μ({xk}),so thatμ(dx)=∑kp(xk) δxk(dx). \density(\point_k) = \mu(\{\point_k\}), \qquad \text{so that} \qquad \mu(\dd\point) = \sum_k \density(\point_k)\, \delta_{\point_k}(\dd\point) .
Proof.

If ν(A)=0\nu(A) = 0 then A=∅A = \emptyset, so μ≪ν\mu \ll \nu, and ν\nu is σ\sigma-finite because X\manifold is countable. Countable additivity gives μ(A)=∑xk∈Aμ({xk})=∫Ap dν\mu(A) = \sum_{\point_k \in A} \mu(\{\point_k\}) = \int_A \density \,\dd\nu with p(xk)=μ({xk})\density(\point_k) = \mu(\{\point_k\}), and uniqueness almost everywhere is uniqueness everywhere, since the only null set is empty.

∎

This is why p\density is called a probability mass function in that case, and why the two cases can be treated as one: a density is always with respect to a reference measure, and a mass function is a density with respect to counting measure.

Nothing in what follows needs these two in particular: a reference measure ν\nu need only be σ\sigma-finite, for Theorem 2 and Tonelli’s theorem to apply, and Lebesgue measure and counting measure, and products of them, are examples, not the only choices. The choice is a modelling decision, though, and a good one makes the density values mean something. A density is a likelihood only relative to its reference measure: p(x)\density(\point) compares how much probability the model puts near x\point with how much ν\nu puts there. So the reference measure should be the one that is as uniform, or as uninformative, as the space allows: Lebesgue measure on a vector space, counting measure on a finite set, and in general the invariant measure of a symmetry the space has, or, loosely, the measure of maximal entropy. Then the factor ν\nu contributes is the same everywhere, and a larger value of p\density means, without correction, a more likely point. With a reference measure that is not uniform, the density absorbs the difference: it is larger where ν\nu is small, and compares points by something other than their likelihood.

Quantities introduced one at a time. Each quantity is drawn from a distribution whose parameters may depend on any quantity introduced before it, through any measurable map, however nonlinear. A vehicle’s position is drawn given its previous position, pushed through a motion model; a range measurement is drawn given the vehicle and a landmark, through the distance between them.

Definition 4(A model built forward).

A model built forward is a finite sequence of quantities i=1,…,ni = 1, \dots, n, each with

  1. a space (Xi,Xi)(\manifold_i, \scrX_i) and a σ\sigma-finite reference measure νi\nu_i on it: for instance Lebesgue measure on Rdi\R^{\dimension_i} or on an open subset of it, or counting measure on a countable set; and
  2. a conditional density: a measurable function pi:Xi×X1×⋯×Xi−1→[0,∞)\density_i : \manifold_i \times \manifold_1 \times \cdots \times \manifold_{i-1} \to [0, \infty) such that pi(⋅∣x<i)\density_i(\cdot \mid \point_{<i}) is a probability density with respect to νi\nu_i for every x<i=(x1,…,xi−1)\point_{<i} = (\point_1, \dots, \point_{i-1}).

Its joint density is p(x)=∏i=1npi(xi∣x<i)\density(\point) = \prod_{i=1}^n \density_i(\point_i \mid \point_{<i}), with respect to the product measure ν=ν1⊗⋯⊗νn\nu = \nu_1 \otimes \cdots \otimes \nu_n on (X,X)(\manifold, \scrX), where X=X1×⋯×Xn\manifold = \manifold_1 \times \cdots \times \manifold_n is the product space and X=X1⊗⋯⊗Xn\scrX = \scrX_1 \otimes \cdots \otimes \scrX_n the product σ\sigma-algebra.

A conditional density written as pi(xi∣x<i)=ϕi(xi;ηi(x<i))\density_i(\point_i \mid \point_{<i}) = \phi_i(\point_i; \eta_i(\point_{<i})), a family of densities ϕi\phi_i with parameters computed from earlier quantities by a measurable map ηi\eta_i, is measurable as a composition of measurable maps, so any such nonlinear dependence is allowed. Nothing else is: there are no quantities without a density, and no dependence on a quantity introduced later.

What the restriction buys#

The first thing it buys is a canonical coordinate space, in the role of Rd\R^\dimension.

Proposition 5(The joint law of a model built forward).

The measure μ(dx)=p(x) ν(dx)\mu(\dd\point) = \density(\point)\, \nu(\dd\point) is a probability measure on X\manifold. For each ii, its marginal on the first ii quantities has density ∏j≤ipj(xj∣x<j)\prod_{j \le i} \density_j(\point_j \mid \point_{<j}) with respect to ν1⊗⋯⊗νi\nu_1 \otimes \cdots \otimes \nu_i, and

κi(A∣x<i)=∫Api(xi∣x<i) νi(dxi) \kernel_i(A \mid \point_{<i}) = \int_A \density_i(\point_i \mid \point_{<i})\, \nu_i(\dd\point_i)

is a version of Pxi∣x<i\rmP_{\randomPoint_i \mid \randomPoint_{<i}}, the regular conditional distribution of the ii-th quantity given the ones before it.

Proof.

The function p\density is non-negative and measurable on the product. By Tonelli’s theorem, integrating over xn\point_n first, then xn−1\point_{n-1}, and so on, each factor pi(⋅∣x<i)\density_i(\cdot \mid \point_{<i}) integrates to 11 against νi\nu_i whatever the earlier coordinates are, so ∫p dν=1\int \density \,\dd\nu = 1, and stopping after the last n−in - i integrals leaves the marginal density on the first ii. For measurable B⊆X<iB \subseteq \manifold_{<i} and A⊆XiA \subseteq \manifold_i, Tonelli again gives μ(x<i∈B, xi∈A)=∫Bκi(A∣x<i) μ<i(dx<i)\mu(\point_{<i} \in B,\ \point_i \in A) = \int_B \kernel_i(A \mid \point_{<i})\, \mu_{<i}(\dd\point_{<i}), with μ<i\mu_{<i} the marginal on the first i−1i - 1, and κi(⋅∣x<i)\kernel_i(\cdot \mid \point_{<i}) is a probability measure for every x<i\point_{<i} and measurable in x<i\point_{<i} for every AA, again by Tonelli.

∎

The probability space can then be taken to be the product space (Ω,F,P)=(X,X,μ)(\Omega, \scrF, \rmP) = (\manifold, \scrX, \mu), and the quantities the coordinate projections from (Ω,F)(\Omega, \scrF) to (Xi,Xi)(\manifold_i, \scrX_i),

xi:Ω→Xi,xi(ω)=xi(x1,…,xn)=xi. \randomPoint_i : \Omega \to \manifold_i, \qquad \randomPoint_i(\omega) = \randomPoint_i(\point_1, \dots, \point_n) = \point_i .

This is the analogue of choosing a basis: the quantities are the coordinates. Nothing is lost by the choice, because every statement the model makes is about the joint law of its quantities, and that law is μ\mu on any space that carries them.

Nor is the restriction to finitely many quantities essential. The construction never used anything about the spaces beyond measurability, and it extends to infinitely many quantities built forward, with no topological assumption, by a theorem that is the right one for models built this way.

Theorem 6(Ionescu-Tulcea).

Let (Xi,Xi)i≥1(\manifold_i, \scrX_i)_{i \ge 1} be any measurable spaces, μ1\mu_1 a probability measure on X1\manifold_1, and for each i≥2i \ge 2 let κi\kernel_i be a probability kernel from X1×⋯×Xi−1\manifold_1 \times \cdots \times \manifold_{i-1} to Xi\manifold_i. There is a unique probability measure μ\mu on ∏i≥1Xi\prod_{i \ge 1} \manifold_i, with its product σ\sigma-algebra, whose marginal on every finite initial product is μ1⊗κ2⊗⋯⊗κi\mu_1 \otimes \kernel_2 \otimes \cdots \otimes \kernel_i.

Kolmogorov’s theorem builds a law from consistent marginals, and needs the spaces to be nice for the marginals to determine one. Ionescu-Tulcea builds it from successive conditional laws, which is exactly what a model built forward provides, and needs nothing. Appending a quantity is extending a basis: the old coordinates keep their joint law, and a new one is added with its conditional law given them.

The second thing the restriction buys is a guarantee about what the model can say. A model speaks only of its quantities, so the random variables it can express are the σ(x)\sigma(\randomPoint)-measurable ones, x=(x1,…,xn)\randomPoint = (\randomPoint_1, \dots, \randomPoint_n), and those are exactly the functions of the quantities. That is a lemma about any measurable map whatever, on any space, not only about the quantities.

Lemma 7(Doob–Dynkin).

Let y:Ω→Y\otherRandomPoint : \Omega \to \otherManifold be any measurable map from a measurable space (Ω,F)(\Omega, \scrF) to any measurable space (Y,Y)(\otherManifold, \scrY), and z:Ω→R\bfz : \Omega \to \R. Then z\bfz is σ(y)\sigma(\otherRandomPoint)-measurable if and only if z=g∘y\bfz = g \circ \otherRandomPoint for some measurable g:Y→Rg : \otherManifold \to \R.

Proof.

If z=g∘y\bfz = g \circ \otherRandomPoint, then z−1(C)=y−1(g−1(C))∈σ(y)\bfz^{-1}(C) = \otherRandomPoint^{-1}(g^{-1}(C)) \in \sigma(\otherRandomPoint) for every Borel C⊆RC \subseteq \R. Conversely, every set in σ(y)\sigma(\otherRandomPoint) is y−1(B)\otherRandomPoint^{-1}(B) for some B∈YB \in \scrY, so an indicator 1y−1(B)\mathbf 1_{\otherRandomPoint^{-1}(B)} is 1B∘y\mathbf 1_B \circ \otherRandomPoint, and by linearity every σ(y)\sigma(\otherRandomPoint)-measurable simple function is g∘yg \circ \otherRandomPoint for a simple gg. A σ(y)\sigma(\otherRandomPoint)-measurable z\bfz is a pointwise limit of such functions gk∘yg_k \circ \otherRandomPoint; the set where (gk)(g_k) converges is measurable, and g=lim⁡kgkg = \lim_k g_k there and 00 elsewhere is measurable with z=g∘y\bfz = g \circ \otherRandomPoint, because the sequence converges at every point of the image of y\otherRandomPoint.

∎

In a model built forward, apply it to the quantities taken together. On the product space, x=(x1,…,xn):Ω→X\randomPoint = (\randomPoint_1, \dots, \randomPoint_n) : \Omega \to \manifold is the identity map, since Ω=X\Omega = \manifold and each xi\randomPoint_i is a coordinate projection. So σ(x)=X=F\sigma(\randomPoint) = \scrX = \scrF: every event is an event about the quantities, every scalar-valued random variable on Ω\Omega is σ(x)\sigma(\randomPoint)-measurable, and by the lemma every one of them takes the form g∘xg \circ \randomPoint. On any other space that carries the quantities, F\scrF may be larger than σ(x)\sigma(\randomPoint), but the random variables the model can express are still the σ(x)\sigma(\randomPoint)-measurable ones, and the conclusion is the same.

Corollary 8(Every expectation is an integral against the joint density).

Let a model built forward be carried by quantities x=(x1,…,xn)\randomPoint = (\randomPoint_1, \dots, \randomPoint_n) on a probability space (Ω,F,P)(\Omega, \scrF, \rmP), so that x\randomPoint has law μ\mu. Every random variable z\bfz the model can express, that is every σ(x)\sigma(\randomPoint)-measurable one, is g∘xg \circ \randomPoint for a measurable gg, and when it is integrable,

E[z]=∫Xg(x) p(x) ν(dx)=∫X1 ⁣ ⁣⋯∫Xng(x)∏i=1npi(xi∣x<i) νn(dxn)⋯ν1(dx1). \E[\bfz] = \int_{\manifold} g(\point)\, \density(\point)\, \nu(\dd\point) = \int_{\manifold_1} \!\!\cdots \int_{\manifold_n} g(\point) \prod_{i=1}^n \density_i(\point_i \mid \point_{<i})\, \nu_n(\dd\point_n) \cdots \nu_1(\dd\point_1) .
Proof.

The first claim is Lemma 7, with y\otherRandomPoint there the quantities x\randomPoint here. For the second, the law of x\randomPoint is μ\mu, so E[g∘x]=∫g dμ\E[g \circ \randomPoint] = \int g \,\dd\mu by the change of variables for image measures, and ∫g dμ=∫gp dν\int g \,\dd\mu = \int g \density \,\dd\nu because p=dμ/dν\density = \dd\mu / \dd\nu. The iterated form is Fubini’s theorem, which applies because gpg \density is ν\nu-integrable.

∎

This is the probabilistic half of the analogy made precise. In linear algebra, a vector of VV is a combination of basis vectors and a linear functional is a combination of coordinates. Here, a random variable is a function of the quantities, an event of the model is a measurable set of their values, and its probability, an expectation, a marginal or a moment is an integral against the product of the conditional densities, in the order the model was built. The integral is explicit, though it is rarely available in closed form; estimating it is what inference algorithms are for.

Mapped values#

A model built forward carries more than its quantities. A mapped value y=f(x)\otherRandomPoint = f(\randomPoint), for a measurable ff, such as a distance between two positions, a predicted measurement, or the parameters of a later kernel, is a random variable of the model like any other, and by Lemma 7 every random variable the model can express is one.

A mapped value is a target, determined by the quantities, not a further source of randomness. Once the quantities are drawn or fixed at x\point, it is computed, y=f(x)\otherPoint = f(\point), and never drawn. So nothing about it needs to be sampled or weighed on its own account. Computing ff on draws of x\randomPoint samples its law f#μf_\# \mu; a weight attached to a draw x\point is already the weight of the pair (x,f(x))(\point, f(\point)), since y\otherPoint adds no randomness to it; and its expectations are those of Corollary 8 for the function h∘fh \circ f:

E[h(y)]=∫Xh(f(x)) p(x) ν(dx). \E[h(\otherRandomPoint)] = \int_{\manifold} h(f(\point))\, \density(\point)\, \nu(\dd\point) .

Its law can be awkward (concentrated on a lower-dimensional set, for instance, with no density with respect to any reference measure), but nothing requires that density: a model’s densities are those of its quantities, and a mapped value enters them only as the argument of a later kernel or likelihood factor, through the quantities it is computed from.

Conditioning and likelihoods#

Observing quantities is conditioning on them, and in this corner it needs no existence theorem: the conditional law is written down from the densities.

Proposition 9(Conditioning is division of densities).

Split the quantities of a model built forward into observed ones OO and free ones FF, and let

pO(xO)=∫p(xF,xO) νF(dxF). \density_O(\point_O) = \int \density(\point_F, \point_O)\, \nu_F(\dd\point_F) .

Then pO\density_O is a density of the law of xO\randomPoint_O, finite νO\nu_O-almost everywhere, and the kernel

PxF∣xO(dxF∣xO)=p(xF,xO)pO(xO) νF(dxF)where 0<pO(xO)<∞, \rmP_{\randomPoint_F \mid \randomPoint_O}(\dd\point_F \mid \point_O) = \frac{\density(\point_F, \point_O)}{\density_O(\point_O)}\, \nu_F(\dd\point_F) \qquad \text{where } 0 < \density_O(\point_O) < \infty,

defined arbitrarily elsewhere, is a regular conditional distribution of xF\randomPoint_F given xO\randomPoint_O.

Proof.

By Tonelli, pO\density_O is measurable and ∫pO dνO=1\int \density_O \,\dd\nu_O = 1, so it is a density of the law of xO\randomPoint_O and is finite νO\nu_O-almost everywhere. The set where it is 00 has probability 00 under that law, and so does the set where it is infinite. For measurable AA and BB,

P(xF∈A, xO∈B)=∫B∫Ap(xF,xO) νF(dxF) νO(dxO)=∫BPxF∣xO(A∣xO) pO(xO) νO(dxO), \rmP(\randomPoint_F \in A,\ \randomPoint_O \in B) = \int_B \int_A \density(\point_F, \point_O)\, \nu_F(\dd\point_F)\, \nu_O(\dd\point_O) = \int_B \rmP_{\randomPoint_F \mid \randomPoint_O}(A \mid \point_O)\, \density_O(\point_O)\, \nu_O(\dd\point_O),

the two exceptional sets contributing nothing to either side, which is the defining property of a regular conditional distribution.

∎

The version is chosen, not discovered: changing the densities on a null set, or the reference measures by a change of coordinates, changes PxF∣xO\rmP_{\randomPoint_F \mid \randomPoint_O} on a null set of observations, which is all the freedom the Borel–Kolmogorov paradox exploits. In a model built forward the choice is made once, by the densities and reference measures the model was written with, and every observation is conditioned on by that same rule. That is also why two densities may only be compared, or divided, when they are with respect to the same reference measure.

The same computation explains a factor that scores no quantity. Multiplying the joint density by a non-negative function and normalizing is a change of measure, and it is always conditioning on data that the model does not carry as a quantity.

Proposition 10(A likelihood factor is a change of measure).

Let L:X→[0,∞)L : \manifold \to [0, \infty) be measurable with 0<Z=∫L dμ<∞0 < Z = \int L \,\dd\mu < \infty. Then μL(dx)=L(x) μ(dx)/Z\mu_L(\dd\point) = L(\point)\, \mu(\dd\point) / Z is a probability measure with density Lp/ZL \density / Z with respect to ν\nu. If L(x)=h(y0∣x)L(\point) = h(\otherPoint_0 \mid \point) for a conditional density hh of a further quantity y\otherRandomPoint appended to the model, then μL\mu_L is the conditional law of x\randomPoint given y=y0\otherRandomPoint = \otherPoint_0, as conditioning by densities gives it.

Proof.

μL\mu_L is a probability measure because ∫L dμ=Z\int L \,\dd\mu = Z, and its density with respect to ν\nu is Lp/ZL \density / Z. With y\otherRandomPoint appended, the joint density is p(x) h(y∣x)\density(\point)\, h(\otherPoint \mid \point), so Proposition 9, with x\randomPoint free and y\otherRandomPoint observed at y0\otherPoint_0, gives the conditional density p(x) h(y0∣x)/pO(y0)\density(\point)\, h(\otherPoint_0 \mid \point) / \density_O(\otherPoint_0), where the marginal density of that statement is pO(y0)=∫h(y0∣x) μ(dx)=Z\density_O(\otherPoint_0) = \int h(\otherPoint_0 \mid \point)\, \mu(\dd\point) = Z.

∎

So a likelihood factor is exactly what its name says: the likelihood of an observation that is not a quantity of the model, already conditioned on.

Parameters and improper priors#

An improper prior, a “density” with infinite integral such as a flat density on a line, cannot be a seed, since it is not a probability measure. It is expressed instead by a parameter and a score. A parameter θ\theta takes values in a space Θ\Theta with a reference measure νΘ\nu_\Theta, like a quantity, but enters with no kernel: the model becomes a family (μθ)θ∈Θ(\mu_\theta)_{\theta \in \Theta}, each of its kernels free to depend on θ\theta measurably, as on any earlier quantity. A score is a likelihood factor S(θ)≥0S(\theta) \ge 0 on the parameter, S≡1S \equiv 1 for the flat prior. With xO\point_O observed, the model then describes

π(dθ,dxF)∝S(θ) pθ(xF,xO) νΘ(dθ) νF(dxF),(11) \pi(\dd\theta, \dd\point_F) \propto S(\theta)\, \density_\theta(\point_F, \point_O)\, \nu_\Theta(\dd\theta)\, \nu_F(\dd\point_F), \tag{11}
(11)

a σ\sigma-finite measure, which is a posterior, after normalizing, exactly when its total mass is finite and positive. Whether it is depends on what is observed: it is a condition on the query, not on the model. Either way, (11) is the objective of optimization, and maximizing log⁡S(θ)+log⁡pθ(xF,xO)\log S(\theta) + \log \density_\theta(\point_F, \point_O) is maximum a posteriori or, with S≡1S \equiv 1, maximum likelihood estimation.

In every other respect a parameter is a quantity: it is a coordinate of the space the model describes, functions of it are random variables of the model, and it is conditioned on or left free like the rest. The one difference is that nothing generates it. An optimizer must be given its starting value, and a sampler must draw it from a proposal qΘ\proposal_\Theta of its own, a density that may depend on earlier quantities like a kernel, and contributes S/qΘS / \proposal_\Theta in all to the weight.

Working with a model built forward#

A model built forward is not a function p\density to be evaluated, but a probability space built quantity by quantity, and the measure theory above lets it be worked with in every way such a space allows, of which evaluating p\density is only one.

  • Quantities are specified by their augmenting kernels. Each quantity xi\randomPoint_i enters the model with the kernel that augments the space built so far,

    κi(dxi∣x<i)=pi(xi∣x<i) νi(dxi),(12) \kernel_i(\dd\point_i \mid \point_{<i}) = \density_i(\point_i \mid \point_{<i})\, \nu_i(\dd\point_i), \tag{12}
    (12)

    the kernel of Proposition 5, so that the model is μ=κ1⊗κ2⊗⋯⊗κn\mu = \kernel_1 \otimes \kernel_2 \otimes \cdots \otimes \kernel_n and appending a quantity is appending a kernel, as in Theorem 6. The kernel is a function of every quantity before it, but it need not depend on all of them, and it seldom does: most kernels read only a few, which is what the graphical representations below are about. Writing

    xi∼κi(dxi∣x<i) \randomPoint_i \sim \kernel_i(\dd\point_i \mid \randomPoint_{<i})

    says that the space is augmented by a new quantity xi\randomPoint_i with kernel κi\kernel_i. When the reference measure νi\nu_i is canonical, or does not matter where it is written, xi∼pi(xi∣x<i) νi(dxi)\randomPoint_i \sim \density_i(\point_i \mid \randomPoint_{<i})\, \nu_i(\dd\point_i) is shortened to xi∼pi(xi∣x<i)\randomPoint_i \sim \density_i(\point_i \mid \randomPoint_{<i}).

  • Likelihoods are built incrementally too. A likelihood factor LjL_j may be added at any point, as a function of the quantities that exist when it is added, and the model’s likelihood is their product L=∏jLjL = \prod_j L_j. The measure the model describes is then L μL\, \mu, normalized, by Proposition 10.

  • The model can be sampled, with weights. Drawing from the kernels in order samples μ\mu. With xO\randomPoint_O observed, drawing the free quantities from their kernels, the observed ones held at their values, samples a measure that differs from the conditional law of Proposition 9, reweighted by LL, by the weight

    w(xF)=L(x)∏i∈Opi(xi∣x<i),(13) \weight(\point_F) = L(\point) \prod_{i \in O} \density_i(\point_i \mid \point_{<i}), \tag{13}
    (13)

    up to a constant: the likelihood of the observations and of the likelihood factors at the drawn point. What such a weighted draw estimates, and what a quantity drawn from something other than its own kernel adds to the weight, is the subject of a later note.

  • Parameters are quantities without a seed. An improper prior is a parameter with a score (11). Nothing generates a parameter, so a sampler draws it from a proposal and an optimizer is given its starting value, and in every other way it is treated as a quantity.

  • Mapped values live in the model. A mapped value y=f(x)\otherRandomPoint = f(\randomPoint) is a value computed from its arguments: sampling them samples it, weighing them weighs it, its expectations are integrals by Corollary 8, and, most of all, later kernels may be parameterized by it. A kernel κj(dxj∣x<j)=ϕj(xj;ηj(x<j)) νj(dxj)\kernel_j(\dd\point_j \mid \point_{<j}) = \phi_j(\point_j; \eta_j(\point_{<j}))\, \nu_j(\dd\point_j) is written by building its parameters ηj\eta_j out of mapped values, composed as freely as any measurable map allows, and derivatives flow through them to the quantities they are built from.

  • Everything is a logarithm. Every product above becomes a sum once its logarithm is taken:

    log⁡p(x)=∑i=1nlog⁡pi(xi∣x<i),log⁡w(xF)=∑jlog⁡Lj(x)+∑i∈Olog⁡pi(xi∣x<i), \log \density(\point) = \sum_{i=1}^n \log \density_i(\point_i \mid \point_{<i}), \qquad \log \weight(\point_F) = \sum_j \log L_j(\point) + \sum_{i \in O} \log \density_i(\point_i \mid \point_{<i}),

    with one term for each kernel, likelihood factor and score. Sums suit what is done with them. A product of many densities underflows where a sum of their logarithms does not; the derivative of a sum is the sum of the derivatives of its terms, each reading only the few quantities it involves; and a normalizing constant becomes an additive constant, which every algorithm that ignores the normalization simply drops.

Graphical representations#

A quantity’s kernel seldom reads every quantity before it. It reads a few, its parents pa⁡(i)⊆{1,…,i−1}\operatorname{pa}(i) \subseteq \{1, \dots, i - 1\}: the kernel is constant in the coordinates xj\point_j with j<ij < i and j∉pa⁡(i)j \notin \operatorname{pa}(i), and so is its density. This is written

κi(dxi∣x<i)=κi(dxi∣xpa⁡(i)),pi(xi∣x<i)=pi(xi∣xpa⁡(i)), \begin{aligned} \kernel_i(\dd\point_i \mid \point_{<i}) &= \kernel_i(\dd\point_i \mid \point_{\operatorname{pa}(i)}), \\ \density_i(\point_i \mid \point_{<i}) &= \density_i(\point_i \mid \point_{\operatorname{pa}(i)}), \end{aligned}

which is an abuse of notation: the right-hand sides are not κi\kernel_i and pi\density_i but the maps they define once the coordinates in which they are constant are removed from their arguments. Read the other way, a statement xi∼κi(dxi∣xi1,…,xin)\randomPoint_i \sim \kernel_i(\dd\point_i \mid \randomPoint_{i_1}, \dots, \randomPoint_{i_n}), or xi∼pi(xi∣xi1,…,xin)\randomPoint_i \sim \density_i(\point_i \mid \randomPoint_{i_1}, \dots, \randomPoint_{i_n}), names the parents of the new quantity at once: pa⁡(i)={i1,…,in}\operatorname{pa}(i) = \{i_1, \dots, i_n\}.

A running example shows what is read off the parents. Five quantities are built as

x1∼p1(x1),x2∼p2(x2),x3∼p3(x3∣x1,x2),x4∼p4(x4∣x3),x5∼p5(x5∣x3), \begin{aligned} \randomPoint_1 &\sim \density_1(\point_1), \\ \randomPoint_2 &\sim \density_2(\point_2), \\ \randomPoint_3 &\sim \density_3(\point_3 \mid \randomPoint_1, \randomPoint_2), \\ \randomPoint_4 &\sim \density_4(\point_4 \mid \randomPoint_3), \\ \randomPoint_5 &\sim \density_5(\point_5 \mid \randomPoint_3), \end{aligned}

and a likelihood factor L(x2,x4)L(\randomPoint_2, \randomPoint_4) is added. The quantities, with an edge from each parent to its child, form the model’s dependence graph. Its roots are the quantities with no parent, and it is acyclic, because every edge points forward in the order the model was built.

A dependence graph
x1\randomPoint_1 x2\randomPoint_2 x3\randomPoint_3 x4\randomPoint_4 x5\randomPoint_5
  • Quantity
  • is a parent of
A dependence graph. The quantities of the running example, with an arrow from each parent to its child: pa⁡(3)={1,2}\operatorname{pa}(3) = \{1, 2\} and pa⁡(4)=pa⁡(5)={3}\operatorname{pa}(4) = \operatorname{pa}(5) = \{3\}. The roots x1\randomPoint_1 and x2\randomPoint_2 may be drawn in either order, and so may x4\randomPoint_4 and x5\randomPoint_5, so 1,2,3,4,51, 2, 3, 4, 5 and 2,1,3,5,42, 1, 3, 5, 4 are both ancestral orders. The likelihood factor generates nothing, and does not appear.

The dependence graph shows how the quantities may be generated from one another through their kernels. An ancestral order is any order of the quantities in which every parent comes before its children. The order the model was built in is one, and there are usually others. Drawing the quantities in any ancestral order, each from its kernel, samples μ\mu, since each kernel reads only quantities already drawn.

The dependence graph says nothing of the likelihood factors, nor of the terms of the joint density at all. The model’s probabilistic graph shows them. Its nodes are the quantities and the terms, the kernel densities and the likelihood factors, and it has an edge from each quantity to every term that reads it and from each kernel density to the quantity it is the density of.

A probabilistic graph
x1\randomPoint_1 x2\randomPoint_2 x3\randomPoint_3 x4\randomPoint_4 x5\randomPoint_5 p1\density_1 p1(x1)\density_1(\point_1)p2\density_2 p2(x2)\density_2(\point_2)p3\density_3 p3(x3∣x1,x2)\density_3(\point_3 \mid \point_1, \point_2)p4\density_4 p4(x4∣x3)\density_4(\point_4 \mid \point_3)p5\density_5 p5(x5∣x3)\density_5(\point_5 \mid \point_3)LL L(x2,x4)L(\point_2, \point_4)
  • Quantity
  • Kernel density
  • Likelihood factor
  • is read by
  • is the density of
A probabilistic graph. The running example with its terms. Each quantity is a circle and each term a square: a kernel density, solid, or a likelihood factor, dashed. A solid arrow runs from a quantity to each term that reads it, and a dotted arrow from a kernel density to the quantity it is the density of. Contracting each kernel density into arrows from what it reads to what it scores, and dropping the likelihood factor, gives back the dependence graph.

Whatever the model, the density of the measure it describes, before normalizing, is a product of its terms, each of the form pi(xi∣xi1,…,xin)\density_i(\point_i \mid \point_{i_1}, \dots, \point_{i_n}) or L(xi1,…,xin)L(\point_{i_1}, \dots, \point_{i_n}). Which term reads which quantity is then what matters, more than which quantity generated which: it says which factors of the joint density change when a quantity does. That is the probabilistic graph with its directions forgotten, the model’s factor graph, in which each term is joined to every quantity it involves.

A factor graph
x1\randomPoint_1 x2\randomPoint_2 x3\randomPoint_3 x4\randomPoint_4 x5\randomPoint_5 p1\density_1 p2\density_2 p3\density_3 p4\density_4 p5\density_5 LL
  • Quantity
  • Kernel density
  • Likelihood factor
  • involves
A factor graph. The probabilistic graph of the running example with its directions forgotten: a line joins each term to every quantity it reads or scores. The terms that involve x3\randomPoint_3 are p3\density_3, which scores it, and p4\density_4 and p5\density_5, which read it; no other term reads it.

The Markov blanket of a quantity is the set of other quantities that appear with it in some term: its parents, its children, the other parents of its children, and whatever a likelihood factor ties it to. Given its blanket, a quantity is conditionally independent of everything else. By Proposition 9 its conditional density given all the others is the joint density divided by a function of the others, and so is proportional, as a function of xi\point_i, to the product of the terms that read xi\point_i, which read nothing outside the blanket. Whatever is done to one quantity, whether it is resampled, optimized or integrated out, therefore touches only the terms that read it and concerns only its blanket. In the factor graph the blanket is the set of quantities two edges away: across each term that involves the quantity, to the other quantities that term involves.

A Markov blanket in the factor graph
x1\randomPoint_1 x2\randomPoint_2 x3\randomPoint_3 x4\randomPoint_4 x5\randomPoint_5 p1\density_1 p2\density_2 p3\density_3 p4\density_4 p5\density_5 LL
  • The quantity x2\randomPoint_2
  • Its Markov blanket
  • Quantity
  • Kernel density
  • Likelihood factor
  • involves
A Markov blanket in the factor graph. The Markov blanket of x2\randomPoint_2, the quantities two lines away from it in the factor graph. The terms that involve it are p2\density_2, p3\density_3 and LL; besides x2\randomPoint_2 they involve x1\randomPoint_1, the other parent of its child; x3\randomPoint_3, its child; and x4\randomPoint_4, which only the likelihood factor ties it to. Resampling, optimizing or integrating out x2\randomPoint_2 reads only those three terms, and nothing outside {x1,x3,x4}\{\randomPoint_1, \randomPoint_3, \randomPoint_4\}.

Every model built forward has all three graphs, each a picture of it at a different level of abstraction: which quantity generates which, which term reads and scores which quantity, and which term involves which quantity. A model is commonly given by one of them.

Built on by