Skip to content

Spike-and-slab prior

Separate exact-zero or small-effect prior components from slab magnitudes, then distinguish inclusion evidence, posterior probabilities and model-averaged coefficients.

A spike-and-slab prior is a mixture that puts some prior probability on a coefficient being zero, or very close to zero, and the rest on a more dispersed distribution of possible effects. In a factor regression, it lets a quant express uncertainty about whether an exposure belongs in the model, alongside uncertainty about its size.

The choice of spike matters: an exact point mass supports literal exclusion; a narrow continuous spike supports strong shrinkage toward zero.

One indicator, two different questions

For an exact-zero spike, write

γj∼Bernoulli⁡(πj),βj∣γj=0∼δ0,βj∣γj=1∼N(0,τj2).\begin{aligned} \gamma_j &\sim \operatorname{Bernoulli}(\pi_j),\\ \beta_j\mid\gamma_j=0 &\sim \delta_0,\\ \beta_j\mid\gamma_j=1 &\sim \mathcal{N}(0,\tau_j^2). \end{aligned}
Here δ0\delta_0 assigns probability one to zero. The marginal prior distribution is (1−πj)δ0+πjN(0,τj2)(1-\pi_j)\delta_0+\pi_j\mathcal{N}(0,\tau_j^2). The prior inclusion probability πj\pi_j controls how likely inclusion is before seeing the data; the slab variance τj2\tau_j^2 controls plausible coefficient magnitudes when included. A slab need not be normal. Mitchell and Beauchamp's original formulation used a point mass and a bounded uniform slab. Their paper motivates this separation.
A continuous alternative replaces δ0\delta_0 with N(0,τ0j2)\mathcal{N}(0,\tau_{0j}^2), where 0<τ0j2≪τj20<\tau_{0j}^2\ll\tau_j^2. Both components then assign probability zero to any single coefficient value. Calling γj=0\gamma_j=0 “excluded” means membership of the small-effect component; it does not mean βj=0\beta_j=0 exactly. George and McCulloch discuss both constructions in §3.1 of their paper.

A density can be tall at zero without placing probability at zero. An exact spike is an atom of probability, not an ordinary density peak of finite height.

Evidence for inclusion can still leave exclusion more likely

Consider a synthetic scalar observation, with arbitrary coefficient units and known noise variance:

y∣θ∼N(θ,1),y=2,θ∼0.8δ0+0.2N(0,4).y\mid\theta\sim\mathcal{N}(\theta,1),\qquad y=2,\qquad \theta\sim0.8\delta_0+0.2\mathcal{N}(0,4).

This is a one-coefficient illustration, not an empirical factor calibration. Under exclusion, the prior predictive distribution of yy is N(0,1)\mathcal{N}(0,1); under inclusion it is N(0,5)\mathcal{N}(0,5), because the noise and prior coefficient variances add. Let ϕ(y;μ,v)\phi(y;\mu,v) denote a normal density with variance vv.

The Bayes factor for inclusion against exclusion is

BF10=ϕ(2;0,5)ϕ(2;0,1)=0.11959340.0539910≈2.2151.BF_{10}=\frac{\phi(2;0,5)}{\phi(2;0,1)} =\frac{0.1195934}{0.0539910}\approx2.2151.
These are predictive densities, not probabilities of observing an exact continuous value. The slab's coefficient has been integrated out; substituting its best-fitting value would give a different comparison.
Bayes' rule gives the posterior inclusion probability, or PIP:
q=P(γ=1∣y)=0.2ϕ(2;0,5)0.8ϕ(2;0,1)+0.2ϕ(2;0,5)≈0.3564.q=\mathbb{P}(\gamma=1\mid y) =\frac{0.2\phi(2;0,5)}{0.8\phi(2;0,1)+0.2\phi(2;0,5)} \approx0.3564.

Equivalently, posterior odds equal prior odds times the Bayes factor: 0.25×2.2151≈0.55380.25\times2.2151\approx0.5538. Evidence has raised inclusion from 20% to 35.64%, while exclusion remains more probable. The prior inclusion probability, PIP and Bayes factor answer different questions; none is interchangeable with the others.

Prior component weights are 80 percent exact zero and 20 percent slab; posterior weights are 64.36 percent exact zero and 35.64 percent slab. The conditional posterior normal density has area one, while its weighted continuous contribution has area 0.3564.
Prior component weights are 80 percent exact zero and 20 percent slab; posterior weights are 64.36 percent exact zero and 35.64 percent slab. The conditional posterior normal density has area one, while its weighted continuous contribution has area 0.3564.
Original synthetic example. Component probabilities are shown separately from continuous densities, so the exact-zero atom is never depicted as a finite density peak.

A coefficient estimate conditional on inclusion is not the average

The included model's normal conjugate update gives
θ∣y,γ=1∼N(1.6,0.8).\theta\mid y,\gamma=1\sim\mathcal{N}(1.6,0.8).

But the full posterior is

θ∣y∼(1−q)δ0+qN(1.6,0.8).\theta\mid y\sim(1-q)\delta_0+q\mathcal{N}(1.6,0.8).

Its posterior mean is q×1.6≈0.5702q\times1.6\approx0.5702, rather than 1.61.6. Reporting only the included-model estimate discards the 64.36% posterior weight on zero. Conversely, selecting the more probable excluded model and reporting zero discards the included model's weight. Bayesian model averaging retains both. A hard selection rule needs a decision objective and associated losses; the mixture prior alone does not dictate a universal inclusion cutoff.

What changes in a factor model

With several candidate predictors, each indicator vector identifies a component model. A predictor's PIP sums posterior weights over all models containing it; it is not the probability of one particular full model. Under multicollinearity, similar predictors can share posterior support, making their individual PIPs sensitive to the candidate set.

Prior inclusion probabilities, coefficient units and slab scales all affect the result. A very diffuse slab spreads its predictive probability widely and can reduce support for inclusion at the observed data. Calibrate plausible effects and inspect sensitivity rather than treating a wide slab as automatically neutral. Numerical exploration across many models also requires adequate posterior exploration; a short search need not represent all the relevant model weight.

For a comparison with penalised point estimates, Ridge, Lasso, and Elastic Net explains shrinkage and sparse fitted coefficients (membership for the full lesson; public preview). A lasso coefficient set to zero is a fitted optimisation result, not a posterior inclusion probability.
Finally, inclusion describes relevance within the specified statistical model. It does not establish causality. Nor does a high PIP demonstrate forecast validity: time ordering, leakage, changing relationships and performance on genuinely held-out periods still matter.

Sources

Last updated
  • bayesian variable selection
  • mixture prior
  • sparsity
  • posterior inclusion
  • model averaging
← Back to the glossaryBack to top ↑