What is Slice Sampling?
Slice Sampling is a Markov Chain Monte Carlo method that augments an unnormalized target density with a random height and updates the state within the level set above that height.
Quick Facts
| Specification | Official Specification |
|---|
How It Works
Augment the target with a slice height
For an unnormalized density f(x), introduce y uniformly on (0, f(x)). Conditional on y, the next state must preserve the uniform distribution over S_y = {x: f(x) > y}. Integrating out y recovers a marginal density proportional to f(x), so the unknown normalizing constant is unnecessary.
Neal's Slice Sampling paper develops univariate and multivariate constructions. The two conditional-looking updates form an MCMC transition; successive retained states are not independent.
Bracket the slice without changing the target
A common univariate implementation places a randomly offset interval of width w, steps its endpoints outward until they leave the slice, then repeatedly proposes inside the interval and shrinks the rejected side. Random placement and current-point-preserving shrinkage are part of the transition, not optional optimizations.
The width w affects density evaluations and movement but need not be the exact slice width. A cap on stepping out prevents unbounded work, yet a cap that truncates a relevant disconnected region can worsen exploration. Work in log density using logY = log f(x) + log(U) to avoid underflow.
Measure geometry, mixing, and evaluation cost
Coordinate-wise Slice Sampling can adapt to local scale while still mixing slowly across correlated directions or separated modes. A single connected interval around the current point does not discover every disconnected component of a level set. Multivariate and elliptical variants solve different geometry problems and require their own validity arguments.
Compare effective samples per log-density evaluation and per second, not acceptance rate, because a valid shrinkage sampler eventually accepts by construction. Inspect multiple chains, bulk and tail ESS, Monte Carlo error, mode occupancy, bracket expansions, and sensitivity to parameterization and width.
Key Characteristics
- Introduces an auxiliary height beneath an unnormalized density
- Updates the state within a target-density level set
- Uses stepping-out or doubling procedures to bracket a slice
- Shrinks rejected intervals while preserving the current state
- Avoids a Metropolis acceptance-rate tuning target
- Can still mix poorly across correlated or disconnected regions
Common Use Cases
- Univariate posterior updates without a convenient proposal scale
- Conditional updates inside a larger Gibbs-style sampler
- Positive or constrained parameters after an appropriate transformation
- Posterior baselines for low-dimensional continuous models
- Sampling latent Gaussian models with a specialized slice variant
Example
Loading code...Frequently Asked Questions
Why does Slice Sampling not need a normalized density?
The algorithm only compares a random slice height with values of an unnormalized positive density. Multiplying that density by a common constant rescales the auxiliary height but leaves the marginal distribution of retained states unchanged.
Is the interval width in Slice Sampling irrelevant?
No. A valid stepping-out and shrinkage construction can preserve the target for many widths, but width strongly affects the number of density evaluations and travel distance. A poor width can make a correct sampler inefficient.
Does every Slice Sampling iteration produce an independent draw?
No. The next slice is anchored at the current state, so draws form a Markov chain. Autocorrelation, effective sample size, Monte Carlo error, and mode coverage still need to be assessed.
How does Slice Sampling differ from Metropolis-Hastings?
Metropolis-Hastings proposes a candidate and may retain the current state after rejection. Slice Sampling augments the density with a height and searches within the corresponding level set, usually accepting after interval shrinkage but spending a variable number of density evaluations.
Can Slice Sampling handle multimodal targets automatically?
Not reliably. A local bracket around the current state may cover only one connected component of a slice. Widely separated modes can remain undiscovered, so dispersed chains, mode-sensitive tests, or a global method may be necessary.