Unit 4 of 7 · about 4 hours · derive, implement
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.
You'll be able to
- 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
Read
In this order, only the parts listed
0 of 4 done
- Named discrete and continuous familiesHarvard Stat 110 - Probability
Lectures 11 to 14 and 16: Poisson, Uniform, Normal, LOTUS and Exponential memorylessness
- MGFs, transformations and convolutionsHarvard Stat 110 - Probability
Lectures 17, 18 and 22: MGFs for Expo and Normal moments, sums of Poissons, transformations, LogNormal and convolutions
- Transformation drillsStat 110 Strategic Practice
Strategic Practice set 8, Transformations Q1-3: Uniform to Beta powers, Box-Muller and the convolution derivation
- Distribution families and change of variablesProbabilistic 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.
Common mistakes · 3
- 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.
Try it yourself
Closed-book, before checking anything
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 against exact with standard error 0.00062.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Derive the density of for , naming the non-monotone step.Answer
on , using the two-sided preimage; differentiating gives on . The monotone CDF rule applied to one branch alone would halve the answer.
2.Why does Box-Muller produce two independent Normals from two Uniforms?Answer
The polar map with has Jacobian factor that splits the joint density into a product of two standard Normal densities. Independence is read off the factored form.
3. counts arrivals per hour and is the wait for the next arrival. Are and the same object?Answer
No. is discrete with mean 2; is continuous with mean 1/2 hour. Same rate parameter, different sample spaces and different questions.
4.In Reproduce, why is
random()with -log enough, and what would break withintegers(0, 2)?AnswerInverse-CDF needs a continuous input so that ; the proof step uses continuity. A discrete input would quantize and the CDF derivation would fail.
random()can also return exactly 0.0 (probability per draw), so library samplers use-log1p(-U)on the same input.
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.
You're done when
You derive the 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.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 2 more in the section
- Harvard Stat 110 - ProbabilityHarvard University · primary
Follow lectures 4-14, 17-23 and 25-30 with matching Strategic Practice. Use lectures 1-3 only for prerequisite repair.
- Stat 110 Strategic PracticeHarvard University · required
Solve the matching sets before marking a probability topic Practised; use solutions to audit reasoning, not to begin it.
- Probabilistic Machine Learning: An IntroductionKevin Murphy · reference
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 bridgeMIT OpenCourseWare · required
Use classes 10-16 for MLE, Bayesian updating, posterior prediction, conjugacy, prior choice and credible intervals.
- D2L - Information TheoryD2L authors · required
Use §§22.11.1-22.11.5 for runnable entropy, cross-entropy, KL and mutual-information examples and exercises.