The model: noise, features and a prior
The topic Bayesian model selection left us with a tool, the evidence, and a promise to use it on the workhorse of machine learning. Linear regression is the right place: with Gaussian noise and a Gaussian prior every integral in it is taken in closed form. The posterior, the predictive distribution and the evidence all come out exactly, so nothing has to be approximated yet.
Each object is turned into a feature vector : the raw features, a constant and , powers of , any fixed functions. The rows form the design matrix ; for plain linear regression . The targets are
with independent noise terms, so the likelihood is . The model is linear in , not in : a cubic in is still linear regression.
The prior is the one from The Bayesian approach, where its MAP estimate turned out to be the L2 penalty:
Both and are precisions. The noise variance is , and the prior variance of each weight is . A large is a tight prior that holds the weights near zero; a large means we trust each target.
Running example. It stays with us for this topic and the next one. Three points and a line with an intercept:
Then
The columns of are orthogonal, so every matrix below stays diagonal and the arithmetic fits on a napkin. Least squares gives .