7 routes42 sections324 units

Unit 3.4 · about 4 h

68 / 324

Common distribution families and transformations

Likelihoods, priors, noise models and initializations are all named distributions. Sampling them and pushing them through transforms is daily work in generative modeling and Bayesian computation.

  • derive
  • implement

You can now

  • Explain the Bernoulli, Binomial, categorical, Gaussian, Exponential and Poisson families, with their means, variances and sampling stories.
  • Derive a change-of-variables density with the Jacobian factor and state the support explicitly.
  • Implement inverse-CDF sampling for a target density and test it against exact moments and tail probabilities.

Covers

  • Bernoulli, binomial, categorical, Gaussian, exponential and Poisson families
  • Transformations of random variables

Study, in this order

4 steps

  1. Named discrete and continuous families
    Harvard Stat 110 - Probability

    Lectures 11 to 14 and 16: Poisson, Uniform, Normal, LOTUS and Exponential memorylessness

  2. MGFs, transformations and convolutions
    Harvard Stat 110 - Probability

    Lectures 17, 18 and 22: MGFs for Expo and Normal moments, sums of Poissons, transformations, LogNormal and convolutions

  3. Transformation drills
    Stat 110 Strategic Practice

    Strategic Practice set 8, Transformations Q1-3: Uniform to Beta powers, Box-Muller and the convolution derivation

  4. Distribution families and change of variables
    Probabilistic Machine Learning: An Introduction

    Chapter 2, Sections 2.4-2.6 (pp. 49-61) for Bernoulli, categorical and Gaussian; Sections 2.8.3-2.8.5 (pp. 67-72) for bijections, the Jacobian factor and convolutions

Focus on

  • Tie each family to a sampling story: counts of trials, waiting times, arrivals per interval. The story selects the family; the data never does by itself.
  • A change of variables multiplies by the Jacobian absolute determinant and re-derives the support. A density without a support is unfinished.
  • Sums of independent variables convolve densities; MGFs turn convolution into multiplication where the MGF exists near zero.
  • Parametrization traps: Exponential and Gamma rate versus scale, Normal variance versus standard deviation. State yours in every signature.

Reproduce closed-book

Closed-book, derive by the CDF method that \(U \sim \operatorname{Uniform}(0,1)\) gives \(X=-\log(U) \sim \operatorname{Expo}(1)\): \(P(X \le x)=P(U \ge e^{-x})=1-e^{-x}\) for \(x \ge 0\), using continuity of \(U\) for the strict-inequality step. Then check with NumPy in float64: numpy.random.default_rng(31), 300000 draws via random() then -log; sample mean 0.9983 and variance 1.0024 against exact 1 and 1, and \(P(X>2)=0.1341\) against exact \(e^{-2}=0.1353\) with standard error 0.00062.

Traps

  • Dropping the Jacobian factor or keeping the old support after a transform. Both silently produce a function that does not integrate to 1.
  • Assuming every distribution has an MGF. Cauchy has none; quote the MGF only with its domain.
  • Confusing Poisson counts with Exponential waiting times. They describe one process from two sides; the units differ.

Practice

Stat 110 Strategic Practice 8: Transformations Q1-3

Strategic Practice set 8, Transformations Q1-3 with the inline solutions; Homework 8 Q4-6 for extra density derivations

Attempt each problem before reading its solution. The solutions are printed in the same file.

Self-test

  1. Derive the density of \(Y=X^2\) for \(X \sim \operatorname{Uniform}(-1, 1)\), naming the non-monotone step.

  2. Why does Box-Muller produce two independent Normals from two Uniforms?

  3. \(X \sim \operatorname{Pois}(2)\) counts arrivals per hour and \(T \sim \operatorname{Expo}(2)\) is the wait for the next arrival. Are \(X\) and \(T\) the same object?

  4. In Reproduce, why is random() with -log enough, and what would break with integers(0, 2)?

Completion criterion

Stop when

You derive the \(-\log(U)\) result and one non-monotone transform without notes, and your rerun of the seed-31 check matches the mean, variance and tail to 3 decimals with the stated standard error.

Mark passed, then open 3.5 Only mark this when you can do it without notes.

Leads to

Resources for this unit

  • Harvard Stat 110 - Probability
    Harvard Universityprimarycourse
    Follow lectures 4-14, 17-23 and 25-30 with matching Strategic Practice. Use lectures 1-3 only for prerequisite repair.
  • Stat 110 Strategic Practice
    Harvard Universityrequiredpractice
    Solve the matching sets before marking a probability topic Practised; use solutions to audit reasoning, not to begin it.
  • Probabilistic Machine Learning: An Introduction
    Kevin Murphyreferencetheory
    Consult targeted parts of Chapters 2, 3, 4 and 6 for ML notation, Monte Carlo, factorization, posterior prediction and information theory.

Also in this section

  • MIT 18.05 - Bayesian bridge
    MIT OpenCourseWarerequiredcourse
    Use classes 10-16 for MLE, Bayesian updating, posterior prediction, conjugacy, prior choice and credible intervals.
  • D2L - Information Theory
    D2L authorsrequiredimplementation
    Use §§22.11.1-22.11.5 for runnable entropy, cross-entropy, KL and mutual-information examples and exercises.

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels