Appendix A
Probability Distributions and Conjugate Atlas
Translating Bayesian derivations into bug-free code hinges on matching mathematical parameterizations to software libraries. This appendix collects every probability distribution used in HoffPeter D. Hoff. A First Course in Bayesian Statistical Methods. Springer Texts in Statistics. Springer, New York, 2009. ISBN 978-0-387-92299-7. doi: 10.1007/978-0-387-92407-6, aligns its exact notation across Hoff, numpy, and scipy.stats, and summarizes all conjugate and semiconjugate updating rules from Chapters 3 through 9.
A.1Common Distributions and Parameterization Map#
A.1.1Discrete Distributions#
Table A.1: Discrete distributions in Hoff (2009) and their exact Python parameterizations.
| Distribution | Support | Mass Function | Mean & Variance | Python (scipy.stats / numpy) |
|---|---|---|---|---|
| , | bernoulli(p=theta) / rng.binomial(1, theta) | |||
| , | binom(n, p=theta) / rng.binomial(n, theta) | |||
| , | poisson(mu=theta) / rng.poisson(theta) | |||
| (Hoff) | , | nbinom(n=a, p=b/(b+1)) |
A.1.2Continuous Scalar Distributions#
Table A.2: Continuous univariate distributions in Hoff (2009) and their exact Python parameterizations.
| Distribution | Support | Density | Mean & Variance | Python (scipy.stats / numpy) |
|---|---|---|---|---|
| , | beta(a, b) / rng.beta(a, b) | |||
| (rate ) | , | gamma(a=a, scale=1/b) / rng.gamma(a, 1/b) | ||
| (), () | invgamma(a=a, scale=b) or 1 / rng.gamma(a, 1/b) | |||
| , | norm(loc=theta, scale=sigma) / rng.normal(theta, sigma) | |||
| (), () | t(df=nu, loc=mu, scale=sigma) |
A.1.3Multivariate and Matrix-Variate Distributions#
Table A.3: Multivariate and matrix-variate distributions in Hoff (2009). Note that multivariate_normal takes the covariance matrix Sigma (unlike scalar norm, which takes standard deviation), and invwishart takes S0 directly rather than S0 inverse.
| Distribution | Support | Density Kernel | Mean | Python (scipy.stats / numpy) |
|---|---|---|---|---|
multivariate_normal(mean=theta, cov=Sigma) / rng.multivariate_normal(theta, Sigma) | ||||
wishart(df=nu, scale=Psi) | ||||
| () | invwishart(df=nu, scale=S0) |
Warning
The Four Golden Coding Checks.
- Scalar
norm/rng.normalexpects standard deviation ;multivariate_normalexpects covariance (squared scale!).gammaandrng.gammaexpect scale (), whereas Hoff’s uses rate .invgamma(a=a, scale=b)expects directly (matching1 / rng.gamma(shape=a, scale=1/b)).invwishart(df=nu, scale=S0)expects directly (not ), matching Hoff’s .
A.2Conjugate and Semiconjugate Updating Atlas#
Table A.4: Master conjugate and semiconjugate updating table spanning Parts I through III.
| Chapter & Model | Prior | Posterior / Full Conditional |
|---|---|---|
| Ch. 3: | ||
| Ch. 3: | ||
| Ch. 5: (joint conjugate) | , | , |
| Ch. 6: (semiconjugate) | , | ; |
| Ch. 7: | , | ; |
| Ch. 9: (-prior) | , | ; |