Key probability distributions

The shape of your data determines your model — and your loss function

Why

Every assumption you make when building a model is implicitly a distributional assumption. When you use MSE loss, you're assuming Gaussian noise. When you use cross-entropy, you're assuming Bernoulli or Categorical outputs. When you initialise weights from a normal distribution, you're using the Gaussian.

Questions like "why cross-entropy for classification?" and "what distribution does softmax output?" both require knowing these distributions cold. Generative models (VAEs, diffusion) are entirely defined by distributional choices.

Intuition

A probability distribution is a function that assigns probabilities to every possible outcome. Different phenomena follow different shapes: coin flips are binary (Bernoulli), class labels are categorical, measurement errors cluster around zero (Gaussian), event counts in time are Poisson.

Choosing the right distribution for your model is choosing the right language to describe your data. Using the wrong one is like measuring distance in seconds — the math will work but the answers will be wrong.

Explanation
Gaussian (Normal) distribution
f(x) = (1 / √(2πσ²)) · exp(-(x-μ)² / (2σ²)) Parameters: μ = mean (centre), σ² = variance (spread) Support: all real numbers (-∞ to +∞) Key property: 68% within 1σ, 95% within 2σ, 99.7% within 3σ

The bell curve. Symmetric around the mean. Ubiquitous because of the Central Limit Theorem: the mean of many independent random variables converges to Gaussian regardless of the original distribution.

In ML: noise in linear regression is assumed Gaussian → MSE is the right loss. Weight initialisation often uses N(0, σ²). Latent variables in VAEs are Gaussian.

Bernoulli distribution
P(X=1) = p, P(X=0) = 1-p Parameter: p ∈ [0,1] = probability of "success" Support: {0, 1} Mean: p, Variance: p(1-p)

Single binary trial. Coin flip is the canonical example. In ML: the output of sigmoid in binary classification is p — the model's estimate of P(y=1|x). Binary cross-entropy loss is derived from the Bernoulli likelihood.

Categorical distribution
P(X=k) = pₖ for k ∈ {1, 2, ..., K} Parameters: p₁, p₂, ..., pₖ with Σpₖ = 1 Support: {1, 2, ..., K} — K mutually exclusive outcomes

Generalises Bernoulli to K classes. In ML: softmax outputs a Categorical distribution — the K numbers sum to 1 and represent the model's probability distribution over classes. Categorical cross-entropy loss is derived from the Categorical likelihood.

Uniform & Poisson distributions
Uniform
f(x) = 1/(b-a) for x ∈ [a, b]. Maximum entropy — encodes "I know nothing." Used in weight initialisation (Xavier uses Uniform(-a, a)) and as a flat prior in Bayesian methods.
Poisson
P(X=k) = (λᵏ·e⁻λ)/k!. Models event counts in a fixed interval. λ = mean = variance. Used for API request rates, word counts in NLP, recommendation systems.
Distribution → loss function cheat sheet
Output distribution Correct loss function ——————————————————————————————— Gaussian noise MSE (mean squared error) Bernoulli (binary classes) Binary cross-entropy Categorical (K classes) Categorical cross-entropy Poisson (count data) Poisson deviance / NLL