Linear Regression Overview
Chapter 8 built a vocabulary and named three flavours of learning. Chapter 9 applies all three to one problem, in order, and the problem is the first of the book’s four pillars: “we aim to find a function that maps inputs to corresponding function values .”
The book’s framing: “we will apply the mathematical concepts from Chapters 2, 5, 6, and 7 to solve linear regression (curve fitting) problems” — and the task is “to find a function that not only models the training data, but generalizes well.”
One problem, three times
Section titled “One problem, three times”| §9.2.1 maximum likelihood | §9.2.3 MAP | §9.3 Bayesian | |
|---|---|---|---|
| what you write down | a likelihood | likelihood prior | the same, and you integrate |
| the answer | a point | a point | a distribution |
| exists when | no | yes | yes |
| predictive interval | width , everywhere | width , everywhere | widens off the data |
| measured coverage | / | the same | / |
Two of the three give the same prediction curve. Measured to : MAP and the Bayesian posterior mean are one curve, because for a Gaussian the mode is the mean. So the case for §9.3 is not about the line — it is entirely about the shading, and the shading is what turns into .
Why this chapter is where the measuring pays off
Section titled “Why this chapter is where the measuring pays off”Everything here has a closed form, so every claim can be checked exactly rather than approximately. Four things the chapter states, and what measuring them turned up:
The book gives two different for one correspondence. Equation 9.33’s text says and Equation 9.34’s says . Measured across five settings, only the second reproduces Equation 9.31 — and Chapter 8 supplies a third, , for its own normalisation. All three are internally correct. A is meaningless without the objective it belongs to.
Equation 9.22’s noise estimate is biased by exactly . The book states it without caveat. Measured at , — Example 9.5’s own setting — it returns half the true variance, and §9.4’s geometry explains why: , so the residual never occupies all dimensions.
Example 9.7’s prior is far wider than its figure can show. With the book’s own and degree-5 monomials, the band is units wide at — on axes drawn from to . It fits inside them at of the plotted inputs. The shape the figure draws is right; the scale is the part worth measuring.
Equation 9.64 is a derivation, not an implementation. It inverts an matrix for a model with parameters. Woodbury gives the same number through a one — faster at — and its determinant factor is , already computed by Theorem 9.1.
The pages
Section titled “The pages”| # | page | book section | the measured claim |
|---|---|---|---|
| 901 | Problem Formulation | §9.1–9.2 | the likelihood integrates to over |
| 902 | Maximum Likelihood Estimation for Linear Regression | §9.2.1 | Eq 9.22 is biased by exactly |
| 903 | Overfitting in Linear Regression | §9.2.2 | the training error never rises — nine steps, zero increases |
| 904 | MAP Estimation and Regularization | §9.2.3–9.2.4 | only reproduces Eq 9.31 |
| 905 | Bayesian Linear Regression | §9.3.1–9.3.2 | the prior’s band is wide at |
| 906 | The Parameter Posterior | §9.3.3 | precisions add, so the update runs online to |
| 907 | Posterior Predictions | §9.3.4 | is unchanged by shuffling the targets |
| 908 | Computing the Marginal Likelihood | §9.3.5 | the evidence picks the same degree a test set does |
| 909 | Maximum Likelihood as Orthogonal Projection | §9.4 | , which explains page 902’s bias |
| 910 | Chapter 9 Worked Problems | — | eight problems, this module’s own |
| 911 | Chapter 9 Formula Sheet | — | every equation and every measured constant |
The thread that runs through it
Section titled “The thread that runs through it”One number appears on three pages by three different routes, and noticing that is most of understanding Bayes’ theorem in this setting:
| where it appears | page | value |
|---|---|---|
| the constant offset making Theorem 9.1 consistent | 906 | |
| the training targets’ density under the prior predictive | 907 | |
| Equation 9.64 evaluated directly | 908 |
It is — the normaliser page 901 found missing when the likelihood turned out to integrate to rather than . Maximum likelihood can ignore it because an argmax ignores scale. Everything else in the chapter needs it, and §8.6 needs it to compare models at all.
What is actually new here
Section titled “What is actually new here”Chapter 8 established the ideas. This chapter supplies the closed forms — and three results that only appear once you have them:
Precisions add, so learning can be sequential. Equation 9.43b is a sum over observations, so feeding the data in any order or grouping gives the same posterior. Measured over points fed one at a time: from the batch answer, in memory, with the design matrix never assembled. The book computes it in one shot; nothing requires that.
The error bars are known before the experiment. contains no — measured, shuffling the targets changes it by exactly zero. So you can choose where to measure to minimise the interval where it matters: a clustered design gives a worst half-width of against for a spread one, a factor of , decided in advance. The same property is why the shading does not widen when the model fits badly.
The estimator is a projection, and that explains two earlier puzzles. gives Equation 9.22’s bias exactly; and since a projection depends on the subspace rather than the basis, page 902’s conditioning catastrophe ( for monomials against for an orthonormal basis, same fit to ) was always a coordinate problem.
Where it goes next
Section titled “Where it goes next”§9.5 points three ways, and all three are visible in what the chapter already computed:
| pointer | and where it already appeared |
|---|---|
| generalized linear models — Eq 9.72, a deep network as a composition of them | Chapter 8’s §8.3.4, and the note that maximum likelihood becomes non-convex |
| Gaussian processes — a distribution placed directly on functions | page 905 measured the induced kernel , including a |
| sparsity priors — Laplace, i.e. LASSO | page 904 measured ridge producing zero exact zeros at any against LASSO’s of |
And the remaining pillars: Chapter 10 applies the same machinery to dimensionality reduction, Chapter 11 to density estimation, Chapter 12 to classification.
Recall card
Section titled “Recall card”- Chapter 9 solves one problem three times — maximum likelihood, MAP, and full Bayesian inference — applying Chapter 8’s three flavours of learning to the first of the four pillars.
- Two of the three give the same prediction curve, to 8.4e-14, because for a Gaussian the mode is the mean. The case for Section 9.3 is entirely about the interval.
- And the interval is what turns 0.1112 into 0.9499 in measured coverage just outside the data.
- The book names two different lambdas for one correspondence, and Chapter 8 supplies a third. All are internally correct; a lambda is meaningless without its objective.
- Equation 9.22’s noise estimate is biased by exactly (N-K)/N, returning half the truth in Example 9.5’s own setting. Section 9.4 explains why: the trace of I minus P is N minus K.
- Example 9.7’s prior implies a 95 percent band 3125.59 units wide at x = 5, on a figure whose axes run from minus four to four.
- Equation 9.64 inverts an N-by-N matrix for a K-parameter model. Woodbury gives the same number 4341 times faster, reusing the posterior precision Theorem 9.1 already computed.
- One number appears on three pages by three routes: 30.453407, the log marginal likelihood — the normaliser page 901 found missing.
- Precisions add, so the posterior update runs online in fixed memory, matching the batch answer to 6.8e-15 over 500 points.
- The error bars never see the targets, so they can be minimised during experimental design — a factor of 605 between a clustered and a spread layout — and they cannot warn you that the model is wrong.
- The estimator is an orthogonal projection, which explains both the noise-variance bias and why the monomial basis’s conditioning disaster was avoidable.
- Section 9.5 points to generalized linear models, Gaussian processes and sparsity priors, and the chapter has already computed a piece of each.
Start here: Problem Formulation
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading