Skip to content

Slice Sampling

An MCMC method that adds a height beneath an unnormalized density and updates within its level-set slice using a transition that preserves the target distribution.

Version
v2 · 2026-10-03 · History
Domain-specific #
13617
Aliases
Slice Sampler, Auxiliary Height Sampling

Core Idea

Slice sampling targets a density proportional to \(f(x)\) by adding a height \(y\) below \(f(x)\) and forming the slice \(S_y=\{x:f(x)>y\}\). An ideal update draws \(y\) uniformly from \((0,f(x))\) and then \(x\) uniformly from the full slice, giving \(f(x)/\int f\) as the stationary marginal. Practical methods may instead use another transition that preserves the slice's uniform conditional law; they do not necessarily draw an independent point from an entire disconnected slice.[1]

How would you explain it like I'm…

Bug Under the Hill

Imagine a hill drawn on paper and a bug standing under the hill's outline. The bug picks a random height somewhere below the outline where it stands, then crawls sideways to a new spot that's still under the outline at that height. Doing this again and again, the bug ends up visiting tall parts of the hill more often. That's slice sampling.

Pick a Height, Slide Sideways

Imagine a hill drawn on paper, where taller parts mean 'pick here more often.' Slice sampling is a way for a computer to wander over the hill so it ends up spending more time where the hill is tall. From where it stands, it picks a random height between the ground and the hill's surface at that spot. Then it looks for a new spot where the hill is taller than that height. Usually it doesn't search the whole hill — it stretches a small window around where it is, and shrinks the window when it misses, so it always lands somewhere allowed.

Auxiliary-Variable Slice MCMC

Slice sampling is a Markov chain Monte Carlo method: it builds a chain of samples whose long-run distribution matches a target distribution known only up to a constant. Picture the region under the graph of the unnormalized density f(x); if you sample uniformly from that region, the x-coordinates follow the target. From the current x, draw a height y uniformly between 0 and f(x). The slice is the set of all x where f(x) > y. Ideally you'd then pick a new x uniformly from the whole slice, but that can be hard if the slice is wide, high-dimensional or broken into pieces. Neal's practical method builds an interval around the current point, widens it by stepping out or doubling, then shrinks it while testing proposals. This keeps the correct distribution without needing a uniform draw from the entire slice. It does not guarantee fast mixing.

 

Slice sampling constructs a Markov chain whose stationary distribution is a target with nonnegative integrable density f known only up to its normalizing constant Z = ∫f(x)dx. It treats the region under the graph, U = {(x, y): 0 < y < f(x)}, as a state space with uniform density, whose x-marginal is f(x)/Z. From the current x, draw a height y uniformly on (0, f(x)); the horizontal slice is S_y = {x: f(x) > y}. An idealized Gibbs-style update would then draw x uniformly from the entire slice, but this is often impractical when the slice is wide, high-dimensional, or disconnected. Neal's practical one-dimensional scheme instead places an interval around the current point, expands it by stepping out or doubling, and uses proposals with shrinkage to define a transition that leaves the uniform distribution on the slice invariant — without necessarily producing an independent uniform draw from the whole slice. That distinction is central to its correctness. Alternating height draws with such horizontal updates leaves f/Z stationary when the conditions are met, but stationarity does not guarantee rapid mixing or access to every disconnected component; Neal gives a zero-density-gap example where ordinary stepping out is not irreducible.

Scope of Application

Neal's scalar method randomly positions an interval around the current state, steps outward and shrinks after rejected proposals. It can update a nonconjugate conditional known only up to normalization. Murray, Adams and MacKay's elliptical specialization instead uses a Gaussian-prior direction and a likelihood threshold along an ellipse for latent Gaussian models. The bracket width of the scalar method and the Gaussian-prior assumption of the elliptical method should not be interchanged.[1][2]

Clarity

The full mathematical slice may have several components; a practical interval is only a constructed search region. Neal explicitly shows that stepping out with fixed width can fail irreducibility across zero-density gaps. Stationarity of a valid kernel is therefore distinct from independent full-slice draws, global reachability and fast finite-run mixing.[1]

Manages Complexity

The auxiliary height converts density sampling into level-set membership and a valid conditional move. Stepping out and shrinkage can adapt to local width, reducing reliance on a single fixed proposal scale, but each density evaluation costs work and separated modes remain challenging. The user must report the actual transition rule and diagnostics rather than only the slice-sampling label.[1]

Abstract Reasoning

Check that \(f\) is nonnegative and integrable, derive the under-graph marginal by integrating out \(y\), and specify whether the horizontal update is ideal full-slice Gibbs or a practical invariant kernel. For a Gaussian-shaped \(f(x)=e^{-x^2/2}\), the illustrative height \(e^{-1/2}\) produces \(S_y=(-1,1)\). Then check reachability and mixing for the chosen practical implementation, particularly across density-zero regions.[1]

Knowledge Transfer

The height-threshold and invariant-transition logic transfers from a scalar bracket method to latent-Gaussian elliptical sampling, but the horizontal geometry and assumptions do not. The live Monte Carlo Simulation prime is the proposed broad parent; Slice Sampling adds the exact under-graph construction. An unrelated data “slice” is only a shared word.[1][2]

Relationships to Other Abstractions

Local relationship map for Slice SamplingParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Slice SamplingDOMAINPrime abstraction: Monte Carlo Simulation — is a kind ofMonte CarloSimulationPRIME

Current abstraction Slice Sampling Domain-specific

Parents (1) — outgoing typed relations

  • Slice Sampling is a kind of Monte Carlo Simulation Prime

    Slice sampling is a Markov-chain Monte Carlo construction with an auxiliary height and slice-invariant update.

Hierarchy paths (3) — routes to 3 parentless roots

Neighborhood in Abstraction Space

Slice Sampling sits in a sparse region of the domain-specific corpus (77th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Numerical Root-Finding & Quadrature Methods (8 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] Radford M. Neal, “Slice Sampling”, Annals of Statistics 31(3), 2003, original paper §3–4 and rejoinder pp.759–760. registry ↩a ↩b ↩c ↩d ↩e ↩f

[2] Iain Murray, Ryan Prescott Adams and David J. C. MacKay, “Elliptical Slice Sampling”, AISTATS 2010, original paper §2 and Figure 2. registry ↩a ↩b