Slice Sampling
Slice sampling draws from a distribution by sampling a random height under its curve and then a random horizontal point along the "slice" at that height, avoiding the hand-tuning that ordinary MCMC step sizes require.
Imagine the shape of a probability distribution as a hill sitting on the number line, its height at each point given by the (unnormalized) probability density. Slice sampling draws a new point from this distribution using a simple two-step trick: from the current point, pick a random height somewhere between zero and the hill's current height — this defines a horizontal "slice" through the hill at that height. Then pick a new horizontal point uniformly at random from wherever that slice intersects the hill (the interval, or set of intervals, where the density is above that height). Repeating this many times produces samples that follow the target distribution.
The appeal over other MCMC methods like a plain random-walk Metropolis sampler is that slice sampling adapts its own step size automatically. A random-walk sampler needs its proposal step size hand-tuned — too small and it explores painfully slowly, too large and it rejects almost everything — while slice sampling's horizontal step naturally shrinks in narrow, peaked regions of the density and widens in flat ones, without the researcher tuning anything.
Worked example. Sampling from a distribution currently at a point with density height 0.8: pick a random auxiliary height, say 0.3, uniformly between 0 and 0.8. Find the interval where the density curve is above 0.3 (this could be wide if the curve is flat near the top, narrow if it's sharply peaked), then draw the next sample point uniformly from within that interval.
Slice sampling replaces a hand-tuned step size with a self-adjusting one: by sampling a random height under the density curve and then a random point along the resulting slice, it naturally takes small steps in peaked regions and large steps in flat ones, at the cost of needing to find where a curve crosses a given height.
Related concepts
Practice in interviews
Further reading
- Neal, 'Slice Sampling', Annals of Statistics (2003)