§3.9.2 The multinoulli distribution
The multinoulli (categorical) distribution multinoulli distribution (Categorical) one discrete variable with k enumerable states, parametrized by p ∈ [0,1]^{k−1}. defined in ch. 3 — open in glossary handles one discrete variable with finite states, parametrized by — the last state’s probability is whatever remains, (so we must keep ). States are usually categories with no numeric value, so expectations and variances of multinoulli variables are rarely needed.
only k−1 = 2 parameters are free; the last state gets what remains: p₃ = 1 − p₁ − p₂ = 0.20
Bernoulli and multinoulli can describe any distribution over their domains — not because they are powerful, but because their domains are simple enough to enumerate. Continuous variables have uncountably many states: any small-parameter description must impose real limits.
§3.9.3 The Gaussian distribution
The most-used distribution over the reals — the normal or Gaussian distribution gaussian distribution N(x; μ, σ²), the bell curve — default for reals via the central limit theorem and max entropy for fixed variance; multivariate form uses covariance Σ or precision matrix. defined in ch. 3 — open in glossary :
Term by term
| the location of the central peak — and the mean, E[x] = μ | real | |
| standard deviation: the width of the peak; variance is σ²; inflection points sit at μ ± σ | real > 0 | |
| the normalizer that makes the area exactly 1 | constant in x | |
| the bell: quadratic penalty for straying from μ, exponentiated | shape term |
peak at x = μ = 0.0; inflection points at μ ± σ; precision β = 1/σ² = 1.00
Evaluating the PDF squares and inverts each time; when evaluating repeatedly with different parameters, the precision precision Inverse variance β = 1/σ² (or matrix β = Σ⁻¹): the cheap-to-evaluate parametrization of a Gaussian. defined in ch. 3 — open in glossary parametrization is cheaper.
Why the Gaussian is the default
Two reasons. (1) The central limit theorem central limit theorem Sums of many independent random variables are approximately normally distributed. defined in ch. 3 — open in glossary : sums of many independent random variables are approximately normal, so complicated systems are successfully modeled as normally distributed noise even when their parts are structured. (2) Among all distributions with a given variance, the normal encodes the maximum uncertainty — it injects the least prior knowledge into a model (made rigorous in §19.4.2).
In it becomes the multivariate normal, parametrized by a positive definite symmetric covariance :
Term by term
| the (now vector-valued) mean | n×1 | |
| the covariance matrix of the distribution (ch. 2 machinery: positive definite, symmetric) | n×n | |
| inverting Σ per evaluation is costly — the precision MATRIX β avoids it | n×n | |
| the volume factor from §2.11 appears in the normalizer | scalar |
Common simplifications: diagonal covariance, or the isotropic Gaussian (covariance = scalar × identity).
Worked example — one density value
Standard normal (, ) at : . At : — about 7× less dense two standard deviations out. (Check both against the widget.)
§3.9.4 Exponential and Laplace
Deep learning often wants a sharp point at — the exponential distribution (the indicator function zeroes all negative ). To put the sharp peak at an arbitrary , use the Laplace distribution laplace distribution Laplace(x; μ, γ): a sharp probability peak at an arbitrary point μ (exponential distribution: sharp point at 0). defined in ch. 3 — open in glossary :
a sharp peak at an ARBITRARY point μ = 0.0 — the movable cousin of the exponential
§3.9.5 Dirac and empirical distributions
To concentrate all mass at one point, use the Dirac delta function: — zero everywhere except , yet integrating to 1. It is not an ordinary function but a generalized function: the limit of functions putting ever less mass everywhere else. Its main job is building the empirical distribution empirical distribution p̂(x) = (1/m) Σ δ(x − x⁽ⁱ⁾): mass 1/m on each training point — what training samples from; maximizes training likelihood. defined in ch. 3 — open in glossary of a dataset:
Term by term
| an infinitely narrow, infinitely tall spike at training point i | generalized fn | |
| each of the m data points carries equal mass | scalar | |
| the distribution you actually SAMPLE from when training on this dataset — and the density that maximizes the likelihood of the data (§5.5) | distribution |
a Dirac spike of mass 1/m = 0.200 at each of the m data points — training samples FROM this
(For discrete variables no Dirac is needed — the empirical distribution is just a multinoulli with probabilities equal to empirical frequencies.)
§3.9.6 Mixtures of distributions
Richer distributions come from combining simple ones. A mixture distribution mixture distribution P(x) = Σᵢ P(c=i) P(x|c=i): a multinoulli picks which component generates each sample. defined in ch. 3 — open in glossary picks, on each trial, which component generates the sample:
Term by term
| the component identity — a multinoulli, and our first LATENT variable: never observed directly | discrete, hidden | |
| the PRIOR αᵢ — the model’s belief about c before seeing x | multinoulli | |
| component i’s own distribution over x | per-component |
The empirical distribution was already a mixture — one Dirac component per example. The latent variable latent variable A random variable that is never observed directly, like the mixture's component identity c. defined in ch. 3 — open in glossary relates to through ; after observing , the updated belief is the posterior posterior probability The updated belief P(c|x) AFTER observing x. defined in ch. 3 — open in glossary (versus the prior prior probability The model's belief P(c) BEFORE observing the data x. defined in ch. 3 — open in glossary ) — vocabulary that chapters 5, 13 and 16–20 use constantly.
The star example: the Gaussian mixture model gaussian mixture model Mixture with Gaussian components (means μ⁽ⁱ⁾, covariances Σ⁽ⁱ⁾, priors αᵢ); universal approximator of smooth densities. defined in ch. 3 — open in glossary , components — a universal approximator of densities (any smooth density, to any nonzero error, with enough components):
P(x) = α·N(x; μ₁, σ²) + (1−α)·N(x; μ₂, σ²): the prior α = P(c=1) = 0.50 picks the component; merge the means and the modes fuse
Fig 3.2 (recreated) — three GMM components with increasingly flexible covariance constraints. Constraints can also be shared across components (Σ⁽ⁱ⁾ = Σ ∀i).
Next: the functions that parametrize these distributions — sigmoid, softplus, Bayes’ rule and information theory.
Check yourself — the distribution zoo
1.Why does a k-state multinoulli use only k−1 parameters?
2.The book gives two reasons the Gaussian is the default distribution over reals. Which pair?
3.When is the precision parametrization β = 1/σ² (or the precision matrix) preferred?
4.What makes the Dirac delta 'not an ordinary function', and why do we need it?
5.In the GMM widget, you slide μ₂ until it equals μ₁. Predict the curve, and name the latent variable.