Basic Prerequisites: Probability & Measure Theory and Econometrics & Time Series. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

Classical (frequentist) statistics treats the parameter as an unknown fixed number and reasons about the data it would generate. Bayesian statistics treats as a random quantity with a distribution - the prior - and learns by multiplying the prior by the likelihood and renormalizing. The product is the posterior , and it is the entire answer: every Bayesian point estimate, interval, and prediction is a functional of it (Casella & Berger §7.2.3).

This matters in finance for one blunt reason: with short samples and many parameters, you cannot afford to ignore prior information. Portfolio weights are famously “estimation-error maximizers” (see MPT & Mean–Variance); Black–Litterman is Bayesian blending; covariance shrinkage is a Bayesian estimator; regime models are hidden-state posteriors. Bayesian statistics is the native language for all of it.

This folder is the topic-folder for that toolbox. This page is the hub: it (a) gives the fast formula lookup below (job #1), and (b) routes you to six sub-pages from raw intuition through Bayes’ theorem and priors, posterior inference, the regularization correspondence, MCMC, and hierarchical models.

The one-sentence essence. “Learning is Bayes’ rule: posterior likelihood prior; conjugate priors make the update closed-form; the posterior is the answer; and when it has no closed form you sample it with a Markov chain (MCMC).”

The four load-bearing objects.

  1. Prior - what you believed before the data. In practice, a regularization device as much as a belief (§02, §04).
  2. Likelihood - the data-generating model (this is the same object a frequentist uses).
  3. Posterior - the complete, updated state of knowledge.
  4. Posterior predictive - the distribution of a new observation after integrating out ; the object you actually trade on (§03).

2. Mathematical Ground Truth & Formula Lookup

Quick-Reference Lookup (job #1). Definitions and conjugate results transcribed from Casella & Berger Ch 7 (§7.2.3 Bayes estimators, Def 7.2.2 conjugacy) and Tsay Ch 12 (§12.3 Bayesian inference; §12.4 Metropolis–Hastings; §12.8 FFBS), cross-checked against Gelman et al. (BDA3) and ESL Ch 3/§8.3. The “verified check” column was re-executed and reproduced exactly by the scripts in §3 and on the sub-pages.

Notation: data; parameter; prior; likelihood; posterior; marginal likelihood/evidence; Beta shape params; between-/within-group variances; is the noise variance, the signal/heterogeneity variance (hierarchical).

ObjectFormulaWhereVerified check
Bayes’ theoremC&B eq. 7.2.6–7.2.7-
Posterior (drop the evidence - it is a constant in )C&B §7.2.3-
Beta–Bernoulli, heads in Tsay §12.3 (res. 12.x), mean
Normal–Normal (known )precision adds: ; mean C&B Ex 7.2.10: prec , var , mean
Gamma–Poisson, Tsay §12.3, mean
Posterior mean (Bayes est., squared error)C&B §7.2.3Beta(7,5):
Posterior mode = MAPC&B §7.2.3Beta(7,5):
Credible interval with ; equal-tailed: C&B §9.2.4Beta(7,5) 95%:
Posterior predictiveC&B §7.2.3Beta–Bernoulli:
Ridge = Gaussian MAPprior penalty , ESL §3.4.1
Lasso = Laplace MAPprior penalty , ESL §3.4.2; 7/10 coeffs exactly 0
Metropolis–Hastings ratio; symmetric : Tsay §12.4.1–12.4.2bimodal target: mean , var (truth , )
Gibbs samplerdraw each block from its full conditional Tsay §12.2bivariate normal : corr
Hierarchical shrinkage, C&B §4.4, BDA3 Ch 5; spread
Ergodicity for an ergodic chainTsay §12.1-
Gelman–Rubin; converge when BDA3 §11.4failure mode, not converged

Conjugacy dictionary (the practical engine of Gibbs). Normal prior on a normal mean; Gamma on a Poisson rate; Beta on a Bernoulli ; Dirichlet on multinomial probabilities; Inverse-Gamma on a normal variance; Normal–Inverse-Gamma jointly on . If the prior is conjugate, the full conditional is often a known family - and a Gibbs step is a closed-form draw.


3. Computational Implementation - one stdlib sanity sweep

Reproduces the check column of every closed-form row above in a single standard-library run.

The full runnable demonstrations (with output) live on the sub-pages: conjugate updating (§01–02), posterior inference and credible intervals (§03), ridge/lasso as MAP (§04), Metropolis–Hastings and Gibbs from scratch (§05), and hierarchical shrinkage (§06).


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the folder’s failure analysis lives on the sub-pages. In one line each:

  1. Prior sensitivity. With little data the posterior is the prior; an informative prior can dominate 8 observations entirely (Beta(20,20) barely moves on 5/8, §01). The prior is a modeling choice with consequences, not a formality.
  2. Improper priors with improper posteriors. A prior does not integrate to 1; the “posterior” is only well-defined if . Improper prior does not guarantee proper posterior - a silent, catastrophic bug (§02).
  3. Credible confidence. A 95% Bayesian credible interval says ; a 95% frequentist confidence interval says nothing of the kind about a fixed . Quoting one as the other is a category error (§03).
  4. MCMC that has not converged. A sampler reports numbers whether or not the chain explored the posterior. Poor mixing under-converges to a mode and biases the estimate (the scale- run reports for a target mean of , §05). Always diagnose (, trace, acceptance rate).
  5. Over-shrinkage under a hierarchical model. As the between-group variance , every group mean is pulled to the grand mean and genuine heterogeneity is erased; with few groups is itself poorly identified (§06).

5. References

  • Gelman, Carlin, Stern, Dunson, Vehtari & Rubin: Bayesian Data Analysis (3rd ed., 2013)
  • McElreath, Richard: Statistical Rethinking (2nd ed., 2020)
  • Hoff, Peter D.: A First Course in Bayesian Statistical Methods (2009)
  • Robert, C. P. & Casella, G.: Monte Carlo Statistical Methods (2nd ed., 2004)
  • Tsay, Ruey S.: Analysis of Financial Time Series (3rd ed., 2010)
  • Casella, G. & Berger, R. L.: Statistical Inference (2nd ed., 2002)
  • Hastie, Tibshirani & Friedman: The Elements of Statistical Learning (2nd ed., 2009)
  • MacKay, D. J. C.: Information Theory, Inference, and Learning Algorithms (2003)
  • Berger, J. O.: Statistical Decision Theory and Bayesian Analysis (2nd ed., 1985) and Robert, C. P.: The Bayesian Choice (2nd ed., 2001)

6. Connected Graph Bridges

  • Foundational base: Probability & Measure Theory (Bayes’ rule, conditional expectation) · Linear Algebra (precision matrices, Gaussian conditionals) · Multivariable Calculus (MAP = optimization, convexity)
  • Sibling foundations: Econometrics & Time Series (MLE, state-space/Kalman - the frequency-side twin of §05–06) · Numerical Methods (Monte Carlo; MCMC is “MC with dependence”) · Stochastic Calculus (measure change; the Radon–Nikodym view of Bayes)
  • Sub-pages (in-folder): 01 From Zero · 02 Bayes’ Theorem & Priors · 03 Posterior Inference · 04 Bayesian & Regularization · 05 MCMC · 06 Advanced Extensions

Beginner: start at 01 · Practitioner: start at 05