Algorithm Search⌘K

Definitionadvanced

Spike-and-slab prior

Also called spike and slab variable selection.

A prior that gives each coefficient a probability of being exactly zero (the spike) and otherwise spreads it out (the slab). The posterior gives each variable a probability of inclusion.

A spike-and-slab prior is a prior for variable selection. Each coefficient βj\beta_j is either zero, with some prior probability, or drawn from a wide distribution, the slab. The point mass at zero is the spike. The posterior then gives each variable a posterior inclusion probability, and it is the same as Bayesian model averaging over all subsets of the variables, written as one model.

Definition

Let β=(β1,…,βp)\beta = (\beta_1, \ldots, \beta_p) be the coefficients of a model, for example a Bayesian linear regression y∼N(Xβ,σ2I)y \sim N(X\beta, \sigma^2 I). Introduce indicators γj∈{0,1}\gamma_j \in \{0, 1\}. The spike-and-slab prior with inclusion probability w∈(0,1)w \in (0, 1) and slab density hh is

γj∼Bernoulli(w),βj∣γj∼(1−γj) δ0+γj h,independently for j=1,…,p.\gamma_j \sim \text{Bernoulli}(w), \qquad \beta_j \mid \gamma_j \sim (1 - \gamma_j)\, \delta_0 + \gamma_j\, h, \qquad \text{independently for } j = 1, \ldots, p.

Here δ0\delta_0 is the point mass at 0. A common slab is h=N(0,s2)h = N(0, s^2), or N(0,s2σ2)N(0, s^2\sigma^2) when σ\sigma is unknown. Mitchell and Beauchamp (1988) used a flat slab on a bounded interval.

The continuous form of George and McCulloch (1993) replaces the point mass by a narrow normal, βj∣γj∼(1−γj)N(0,v0)+γjN(0,v1)\beta_j \mid \gamma_j \sim (1 - \gamma_j) N(0, v_0) + \gamma_j N(0, v_1) with v0≪v1v_0 \ll v_1. Then no coefficient is exactly zero, but the Gibbs updates are simple.

The posterior inclusion probability of variable jj is PIPj=P(γj=1∣y)\mathrm{PIP}_j = P(\gamma_j = 1 \mid y). The vector γ\gamma names a model (the set of included variables), and P(γ∣y)∝P(γ) m(y∣γ)P(\gamma \mid y) \propto P(\gamma)\, m(y \mid \gamma) is its posterior probability, with m(y∣γ)m(y \mid \gamma) the marginal likelihood of the regression on the included columns.

The normal means case, exact. Let y∼N(β,1)y \sim N(\beta, 1) for one coefficient, with slab N(0,s2)N(0, s^2). The marginal law of yy is N(0,1)N(0, 1) under the spike and N(0,1+s2)N(0, 1 + s^2) under the slab, so

PIP(y)=w N(y;0,1+s2)w N(y;0,1+s2)+(1−w) N(y;0,1),E[β∣y]=PIP(y)⋅s21+s2 y.\mathrm{PIP}(y) = \frac{w\, N(y; 0, 1 + s^2)}{w\, N(y; 0, 1 + s^2) + (1 - w)\, N(y; 0, 1)}, \qquad \mathbb{E}[\beta \mid y] = \mathrm{PIP}(y)\cdot \frac{s^2}{1 + s^2}\, y.

Proof. The first formula is Bayes's theorem for γ\gamma, with the two marginal laws as likelihoods. Given γ=1\gamma = 1, the normal prior and likelihood give β∣y,γ=1∼N(s21+s2y,s21+s2)\beta \mid y, \gamma = 1 \sim N\big(\tfrac{s^2}{1 + s^2}y, \tfrac{s^2}{1 + s^2}\big); given γ=0\gamma = 0, β=0\beta = 0. Average the two conditional means with weights PIP\mathrm{PIP} and 1−PIP1 - \mathrm{PIP}. □\square

The posterior odds of inclusion are the prior odds w/(1−w)w/(1 - w) times the Bayes factor N(y;0,1+s2)/N(y;0,1)N(y; 0, 1 + s^2)/N(y; 0, 1) of the slab against the spike. With w=1/2w = 1/2, PIP=1/2\mathrm{PIP} = 1/2 exactly when y2=1+s2s2log⁡(1+s2)y^2 = \frac{1 + s^2}{s^2}\log(1 + s^2).

Examples and non-examples

Example: selective shrinkage. With w=1/2w = 1/2 and s2=10s^2 = 10 in the normal means case, PIP=1/2\mathrm{PIP} = 1/2 at ∣y∣=1.1ln⁡11=1.624\lvert y\rvert = \sqrt{1.1\ln 11} = 1.624, and:

yy 0 1 2 3 4 5
PIP\mathrm{PIP} 0.232 0.322 0.650 0.947 0.998 1.000
E[β∣y]\mathbb{E}[\beta \mid y], spike and slab 0 0.293 1.182 2.584 3.628 4.545
E[β∣y]\mathbb{E}[\beta \mid y], horseshoe (τ=1\tau = 1) 0 0.380 1.063 2.210 3.448 4.579
E[β∣y]\mathbb{E}[\beta \mid y], prior N(0,10)N(0, 10) 0 0.909 1.818 2.727 3.636 4.545

Small observations are pulled hard toward 0 and large ones are left almost alone, at the factor 10/1110/11 of the slab. A single normal prior cannot do both: it shrinks every yy by the same factor. The horseshoe prior does a similar thing with a continuous prior. The posterior mean is never exactly 0 for y≠0y \ne 0; the posterior median is 0 whenever PIP<1/2\mathrm{PIP} < 1/2, so the median is a thresholding rule.

Example: the two-groups model. In large-scale testing, each zz-value is null with probability π0\pi_0 and has a slab density otherwise. This is a spike-and-slab prior on the effects, and 1−PIP1 - \mathrm{PIP} is the local false discovery rate.

Example: regression. For pp regressors, the posterior over γ\gamma is a posterior over the 2p2^p subsets, and the posterior mean of β\beta is the model average of the subset estimates. The median probability model keeps the variables with PIPj≥1/2\mathrm{PIP}_j \ge 1/2; Barbieri and Berger (2004) show that it is the best single model for prediction in some normal linear models.

Non-example: the Laplace prior. The lasso estimate is the posterior mode under independent Laplace priors, and it has exact zeros. But the Laplace prior has no point mass, so every coefficient has posterior probability 0 of being 0, and its posterior mean is never sparse. The sparsity of the lasso is a property of the mode, not of the prior.

Non-example: a normal prior. Ridge regression is the posterior mean under βj∼N(0,s2)\beta_j \sim N(0, s^2), the slab alone. It shrinks all coefficients by the same factor in the orthogonal case and selects nothing.

Non-example: the horseshoe. The horseshoe prior is a continuous scale mixture of normals with a pole at 0. It mimics the spike and slab in its posterior mean, but it has no indicator and no inclusion probability.

  • Bayesian model averaging. The spike-and-slab posterior is BMA over subsets with the prior P(γ)=w∣γ∣(1−w)p−∣γ∣P(\gamma) = w^{\lvert\gamma\rvert}(1 - w)^{p - \lvert\gamma\rvert}.
  • The prior on ww and multiplicity. With ww fixed, adding more noise variables does not make the prior more cautious. A prior w∼w \sim Beta(a,b)(a, b) makes the model size beta-binomial, and Scott and Berger (2010) show that this gives an automatic multiplicity correction. Estimating ww by maximizing the marginal likelihood is empirical Bayes and behaves similarly for large pp, but it can collapse to w^=0\hat w = 0.
  • Slab width and the Lindley paradox. As s2→∞s^2 \to \infty the Bayes factor for the slab goes to 0, and every PIP goes to 0. At y=2.5y = 2.5 with w=1/2w = 1/2, PIP\mathrm{PIP} is 0.8380.838, 0.6870.687, 0.1850.185 and 0.0220.022 for s2=10s^2 = 10, 10210^2, 10410^4 and 10610^6. This is the Lindley paradox for one coefficient, so the slab must be proper and of a sensible width.
  • Savage-Dickey density ratio. The Bayes factor of the spike against the slab for one coefficient is the posterior density of βj\beta_j at 0 under the slab alone, divided by the slab density at 0, when the other coefficients have the same prior in both models.
  • Computation. With the point mass, a Gibbs sampler must update γj\gamma_j with βj\beta_j integrated out, because given βj≠0\beta_j \ne 0 the indicator cannot change. With conjugate normal slabs, m(y∣γ)m(y \mid \gamma) has a closed form and the sampler can work on γ\gamma alone. The continuous form of George and McCulloch updates γj\gamma_j given βj\beta_j directly.
  • Spike-and-slab lasso. Ročková and George (2018) use a narrow Laplace spike and a wide Laplace slab, so that the posterior mode is sparse and can be found quickly, as for the lasso.
  • Rescaled spike and slab. Ishwaran and Rao (2005) study continuous spike and slab priors with a hypervariance and their frequentist behaviour.

References

  1. Mitchell and Beauchamp 1988, the prior with a point mass at zero and a flat slab, and the name spike and slab (general locator)
  2. George and McCulloch 1993, stochastic search variable selection with a narrow normal spike and a wide normal slab, sampled by Gibbs sampling (general locator)
  3. Ishwaran and Rao 2005, rescaled spike and slab models and their selective shrinkage (general locator)
  4. Scott and Berger 2010, a prior on the inclusion probability and the multiplicity correction it gives, compared with empirical Bayes (general locator)
  5. Barbieri and Berger 2004, the median probability model (general locator)
  6. Ročková and George 2018, Laplace spike and slab densities and the fast posterior mode (general locator)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/R7P8PD/text.yaml