Slice Sampling
Slice Sampling MCMC · Also known as: slice sampler, Neal slice sampler, uniform slice sampling, auxiliary variable slice sampler
Slice sampling is a Markov chain Monte Carlo (MCMC) algorithm introduced by Radford M. Neal in his 2003 Annals of Statistics paper. It generates samples from a target distribution by drawing uniformly from the region under the density curve — called the 'slice' — without requiring the user to specify a step-size or proposal distribution, making it self-tuning and broadly applicable for Bayesian posterior inference.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Slice sampling is well suited to unimodal or weakly multimodal continuous posteriors where Metropolis–Hastings performs poorly because of sensitivity to step-size tuning. It is particularly attractive when the posterior is defined up to a normalising constant (as in most Bayesian models), because only evaluations of the unnormalised density f(θ) are needed. It is available out-of-the-box in PyMC and Stan-adjacent samplers, making it accessible without custom implementation. It is less effective for high-dimensional problems (curse of dimensionality) or sharply multimodal posteriors where the slice may fragment into disconnected regions.
Strengths & limitations
- Self-tuning: requires no step-size or proposal distribution specification, removing the most common tuning burden of Metropolis–Hastings.
- Guaranteed detailed balance: the shrinkage procedure maintains the correct invariant distribution without accept/reject overhead.
- Efficient for low-to-moderate dimensions: the adaptive bracket expands to match the local scale of the posterior automatically.
- Requires only unnormalised density evaluations, so it works directly with Bayesian posteriors defined up to a constant.
- Performance degrades in high dimensions because the univariate slice must be applied coordinate-by-coordinate or via hyperplane slices, making mixing slow.
- Fragmented or sharply multimodal posteriors may trap the sampler in a single mode if the modes are separated by low-density regions below the current slice height.
- Each iteration may require multiple density evaluations during the stepping-out and shrinkage phases, making it more expensive per sample than a simple Metropolis step when the density is costly to evaluate.
- The univariate version does not exploit posterior geometry (gradients), so it is generally less efficient than Hamiltonian Monte Carlo for smooth, high-dimensional targets.
Frequently asked
How does slice sampling differ from Metropolis–Hastings?
Metropolis–Hastings proposes a candidate from a user-specified proposal distribution and accepts or rejects it. Its efficiency depends critically on choosing a good proposal scale. Slice sampling eliminates this choice: it constructs the proposal region (the slice and bracket) automatically from the density itself, and every candidate that lies inside the slice is accepted. This makes slice sampling easier to apply but does not make it universally faster — for smooth, high-dimensional posteriors, HMC typically outperforms both.
Does slice sampling always converge to the correct posterior?
Yes, under mild regularity conditions. Neal (2003) proved that the stepping-out and shrinkage procedures maintain detailed balance with respect to the target distribution, guaranteeing that the chain's stationary distribution is the target. Geometric ergodicity — meaning the chain converges at an exponential rate — holds for log-concave targets. As with all MCMC, convergence is asymptotic, so convergence diagnostics (R-hat, ESS) must be checked in practice.
Can slice sampling handle multimodal posteriors?
Only partially. If the posterior has well-separated modes and the density between them falls below the current slice height, the sampler may be unable to jump between modes — the slice becomes disconnected. Extensions such as parallel tempering or combining slice sampling with a global jump proposal are needed for reliable exploration of multimodal posteriors.
What is the 'stepping-out' width parameter and how do I set it?
The width w is an initial guess for the bracket size around the current point. Neal (2003) shows the algorithm is correct for any positive w: if w is too small the bracket is expanded (stepped out) until it covers the slice; if too large it is shrunk. A reasonable default is a fraction of the prior standard deviation. In PyMC the width is adapted automatically during tuning, so manual specification is rarely needed.
Sources
- Neal, R. M. (2003). Slice sampling (with discussion). Annals of Statistics, 31(3), 705–767. DOI: 10.1214/aos/1056562461 ↗
- Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian Data Analysis (3rd ed.). CRC Press. ISBN: 978-1439840955
- Robert, C. P., & Casella, G. (2004). Monte Carlo Statistical Methods (2nd ed.). Springer. ISBN: 978-0387212395
How to cite this page
ScholarGate. (2026, June 3). Slice Sampling MCMC. ScholarGate. https://scholargate.app/en/bayesian/slice-sampling
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Bayesian RegressionBayesian↔ compare
- Gibbs SamplingBayesian↔ compare
- Hamiltonian Monte CarloBayesian↔ compare
- MCMCBayesian↔ compare