Update a Gaussian coefficient prior and distinguish posterior coefficient uncertainty, latent-response uncertainty and new-observation predictive uncertainty.
Bayesian linear regression
Bayesian linear regression puts a prior distribution on the coefficients of a linear regression and updates it with observed data to obtain a posterior distribution. A quant estimating a factor exposure can then carry uncertainty about that exposure into a conditional prediction, instead of treating one fitted slope as certain.
The crucial distinction is between uncertainty about a coefficient, uncertainty about the mean response, and uncertainty about a new observation. Those three distributions can have very different variances.
Specify the model before updating it
For a design matrix X with one observation per row, consider
y=Xβ+ε,ε∼N(0,σ2I),β∼N(m0,V0).
Here inputs are conditioned on, noise is independent across observations and independent of the coefficients, σ2>0 is known, and V0 is positive definite. An intercept, if wanted, needs its own column of ones and a specified prior. “Linear” means linear in the coefficients; predetermined nonlinear transformations of inputs can also appear as columns of X.
The prior expresses assumptions before these observations. Multiplying its density by the likelihood and normalising gives a Gaussian posterior:
Prior and data precisions, meaning inverse covariances here, add. These are the Gaussian update formulas developed in Rasmussen and Williams, §2.1.1, written with observations in rows rather than their column convention.
Two observations, three uncertainty statements
Take an original, synthetic scalar example in arbitrary units:
yi=xiβ+εi,β∼N(0,1),εi∼iidN(0,1).
There is no intercept. Observe (x1,y1)=(1,1) and (x2,y2)=(2,2). Although the two points lie exactly on y=x, the model stipulates noise variance one; two neat points do not make it zero.
The scalar update is
vn=1+12+221=61,mn=vn(1⋅1+2⋅2)=65.
Thus β∣D∼N(5/6,1/6). To see the update directly, the negative log posterior, up to constants and a factor of one half, contains
β2+(1−β)2+(2−2β)2=6(β−65)2+65.
The no-intercept least-squares slope is 1. The posterior mean 5/6 is pulled toward the prior mean zero: a concrete instance of shrinkage.
Now supply a new input x∗=3. Define the latent response f∗=3β and a fresh observation y∗=3β+ε∗, where the new noise is independent and has variance one.
Quantity, conditional on the observed data
Mean
Variance
Coefficient β
5/6
1/6
Latent mean response f∗=3β
2.5
9/6=1.5
New observation y∗ at x∗=3
2.5
1+1.5=2.5
Coefficient variance is in squared coefficient units; the other two variances are in squared response units. Equal means do not make the latent response and the new observation interchangeable.
Synthetic no-intercept example. The coefficient prior has mean zero and variance one; its posterior has mean five sixths and variance one sixth. At input three, the latent response and new observation both have mean 2.5, with variances 1.5 and 2.5 respectively.
Original synthetic example. The upper panel compares coefficient densities; the lower panel compares response densities at a supplied input of three. The wider dashed response curve includes fresh observation noise.
Prediction averages over the coefficients
For a supplied vector x∗, integrating over the coefficient posterior gives
The second variance adds the noise remaining even if the coefficients were known. Plugging the posterior mean into the observation model would retain only σ2 and discard coefficient uncertainty. Hughes's Tufts notes, Parts 2–4, contrast these prediction strategies.
In the example, x∗=3 lies outside the observed input range. The larger latent variance reflects slope uncertainty under the stipulated straight-line model. It does not measure how wrong that model might be outside its training range. At x∗=0, latent variance is exactly zero because the no-intercept specification forces the mean response to zero; a new observation still has variance one.
What the posterior leaves conditional
A zero-centred Gaussian prior produces a quadratic coefficient penalty. In the isotropic case V0=τ2I, the posterior mode minimises squared residuals plus (σ2/τ2)∥β∥2: the ridge regression connection. Matching a point estimate does not supply the whole posterior. Prior scale also depends on input units; rescaling a predictor while retaining the same numerical coefficient prior changes the model.
Known noise variance is a deliberate simplification. If variance is unknown, it needs a prior and joint updating. Under an appropriate conjugate normal–inverse-gamma specification, integrating it out produces Student-t coefficient and predictive distributions; this is not achieved by silently replacing σ2 with a residual estimate. Taboga's treatment separates the known- and unknown-variance models. Other priors need not give the same distributional form.
For financial data, serially dependent or changing-variance errors, unstable exposures and omitted predictors can invalidate the stated likelihood. A narrow posterior is conditional on that likelihood and prior. It is not evidence that those choices are correct.
Finally, an exposure regression using market and asset returns from the same period is an in-sample relationship. A forecast requires inputs available at its decision time, a specified horizon and evaluation on later unseen outcomes. If a future predictor is itself unknown, these conditional formulas do not integrate its uncertainty. Bayesian updating does not remove look-ahead bias.
For the conjugate-update foundation, read Bayesian Reasoning. For the least-squares comparison and coefficient inference, read Linear Regression. Both full lessons require membership, with public previews.