36 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 \(9\) times in \(13\) flips: its empirical bias is \(9/13 \approx 0.69\), 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 36.1), joint distributions and Jacobian transformations (Section 36.2), the standard named distributions (Section 36.3), and their unification in the exponential family (Section 36.4), which explains why linear, logistic, and softmax regression all share the gradient “prediction minus observation.” Next, Section 36.5 develops error bars, hypothesis tests, confidence intervals, and the bootstrap, while Section 36.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 36.7), followed by Laplace, Monte Carlo, Markov chain Monte Carlo, and variational approximations when posteriors lack closed forms (Section 36.8). Finally, Section 36.9 proves finite-sample tail bounds and high-dimensional shell concentration, Section 36.10 extends them to post-selection uniform convergence (Section 3.5), and Section 36.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 36.8 and Section 36.11 can be skipped on a first pass without breaking later dependencies. Full entropy and divergence theory continues in Chapter 37, while measure theory, time series, and nonparametric extensions are surveyed in Section 36.12.