Chapter 4 notes, for the binary response model: labels \(t_n\in\{0,1\}\), weights \(\mathbf{w}\), sigmoid likelihood and a Gaussian prior. An interactive page works through every step below with sliders for \(\mathbf{w}\) and \(\sigma^2\).
The numerator is \(g(\mathbf{w}) = p(\mathbf{t}\mid\mathbf{X},\mathbf{w})\,p(\mathbf{w}\mid\sigma^2)\) and the denominator \(Z\) is the marginal likelihood. The book writes the factor that multiplies \(g\) as \(Z^{-1}\): \(Z\) is the normaliser (the integral of \(g\)), and the posterior divides by it. This is just a naming convention. Both \(Z\) and \(1/Z\) are equally unknown here.
Pick a specific weight vector. Two numbers multiply:
Multiply the two to get \(g(\mathbf{w})\). A product of many numbers below 1 becomes tiny, so in practice add logs: \(\log g = \log\text{likelihood}+\log\text{prior}\).
A weight vector whose boundary separates the classes correctly gives each point a high probability for its own label, so the likelihood is near 1. A weight vector that points the wrong way gives most points a low probability, and the likelihood collapses. The prior then penalises large weights.
\(g(\mathbf{w})\) is a completely known function: give it any \(\mathbf{w}\) and it returns a number. Evaluated for every \(\mathbf{w}\) it is the shape of the posterior, only on the wrong vertical scale. With two weights you can evaluate it on a grid of \((w_1,w_2)\) and draw a heat map or contours.
What is intractable is turning that function into what Bayesian inference needs. Each of these is an integral over \(\mathbf{w}\):
None has a closed form here, because the product of sigmoid factors with a Gaussian is not a recognisable density, so there are no formulas for its integrals or moments.
The conjugate contrast. In the coin example \(g\) was proportional to a beta density. Recognising the family gave the mean, the variance and a sampler for free. Knowing \(g\) pointwise was not what made that case tractable. Belonging to a family with known integrals was.
Why a grid is not the answer in general. With two weights, summing \(g\) over a grid gives rough values for \(Z\) and for the posterior mean. With \(D\) weights, the number of grid points needed grows like (points per axis)\(^D\), which quickly becomes impossible.
The heat map of \(g\) on the interactive page shows why the peak and the mean differ: the surface is skewed, so its centre of mass is not at its peak, and a symmetric Gaussian at the peak (Laplace) cannot capture that.
The boundary is where \(P(t=1)=0.5\), i.e. \(\mathbf{w}^T\mathbf{x}=0\):
\[w_1x_1+w_2x_2=0 \;\Longrightarrow\; x_2=-\frac{w_1}{w_2}\,x_1 .\]