24 Probability and Statistical Learning
Throughout the main text, we train regression models with squared error and classifiers with cross-entropy (Section 2.1, Section 3.1), report accuracies on finite test sets, and pick models by comparing validation scores (Section 2.6). Every one of those steps draws an inference from a finite sample. Consider a coin that lands heads times in flips: its empirical bias is , yet a fair coin produces at least nine heads more than one time in eight. A test accuracy is that same coin flipped once per test example, and this chapter develops the mathematics that explains when finite samples support reliable conclusions and when they mislead us.
Sorting out sample uncertainty rests on four distinct ideas: a distribution describing how outcomes vary; an estimator mapping a sample to a number, whose spread across hypothetical samples differs from a posterior conditioned on the single sample in front of us; and a generalization bound certifying when low error on a finite sample guarantees low error on fresh data.
We take these four ideas in order. First, we establish continuous densities (Section 24.1), joint distributions and Jacobian transformations (Section 24.2), the standard named distributions (Section 24.3), and their unification in the exponential family (Section 24.4), which explains why linear, logistic, and softmax regression all share the gradient "prediction minus observation." Next, Section 24.5 develops error bars, hypothesis tests, confidence intervals, and the bootstrap, while Section 24.6 derives our training losses from maximum likelihood and links parameter variance to Fisher curvature. Hidden variables motivate the evidence lower bound and expectation--maximization (Section 24.7), followed by Laplace, Monte Carlo, Markov chain Monte Carlo, and variational approximations when posteriors lack closed forms (Section 24.8). Finally, Section 24.9 proves finite-sample tail bounds and high-dimensional shell concentration, Section 24.10 extends them to post-selection uniform convergence (Section 3.5), and Section 24.11 puts distributions, smoothing, and calibration to work on image classification.
Readers familiar with Section 1.6 can skim the opening moment algebra, and Section 24.8 and Section 24.11 can be skipped on a first pass without breaking later dependencies. Full entropy and divergence theory continues in Chapter 25, while measure theory, time series, and nonparametric extensions are surveyed in Section 24.12.
- 24.1 Random Variables
- 24.2 Joint Distributions and Transformations
- 24.3 Distributions
- 24.4 The Exponential Family
- 24.5 Statistics
- 24.6 Maximum Likelihood
- 24.7 Latent Variables, EM, and the ELBO
- 24.8 Bayesian Computation
- 24.9 Concentration Inequalities
- 24.10 Uniform Convergence and Generalization
- 24.11 Naive Bayes
- 24.12 Further Reading