Slice sampling: Difference between revisions

Content deleted Content added
mNo edit summary
Tags: Mobile edit Mobile app edit iOS app edit
m Fixes missing end tags lints
 
(One intermediate revision by one other user not shown)
Line 44:
Slice sampling gets its name from the first step: defining a ''slice'' by sampling from an auxiliary variable <math>Y</math>. This variable is sampled from <math>[0, f(x)]</math>, where <math>f(x)</math> is either the [[probability density function]] (PDF) of ''X'' or is at least proportional to its PDF. This defines a slice of ''X'' where <math>f(x) \ge Y</math>. In other words, we are now looking at a region of ''X'' where the probability density is at least <math>Y</math>. Then the next value of ''X'' is sampled uniformly from this slice. A new value of <math>Y</math> is sampled, then ''X'', and so on. This can be visualized as alternatively sampling the y-position and then the x-position of points under PDF, thus the ''X''s are from the desired distribution. The <math>Y</math> values have no particular consequences or interpretations outside of their usefulness for the procedure.
 
If both the PDF and its inverse are available, and the distribution is unimodal, then finding the slice and sampling from it are simple. If not, a stepping-out procedure can be used to find a region whose endpoints fall outside the slice. Then, a sample can be drawn from the slice using [[rejection sampling]]. Various procedures for this are described in detail by [[Radford M. Neal]].<ref name="radford03"/>
 
Note that, in contrast to many available methods for generating random numbers from non-uniform distributions, random variates generated directly by this approach will exhibit serial statistical dependence. This is because to draw the next sample, we define the slice based on the value of ''f''(''x'') for the current sample.
Line 71:
In practice, sampling from a horizontal slice of a multimodal distribution is difficult. There is a tension between obtaining a large sampling region and thereby making possible large moves in the distribution space, and obtaining a simpler sampling region to increase efficiency. One option for simplifying this process is regional expansion and contraction.
 
* First, a width parameter ''w'' is used to define the area containing the given ''x'' value. Each endpoint of this area is tested to see if it lies outside the given slice. If not, the region is extended in the appropriate direction(s) by ''w'' until the end both endpoints lie outside the slice.
* A candidate sample is selected uniformly from within this region. If the candidate sample lies inside of the slice, then it is accepted as the new sample. If it lies outside of the slice, the candidate point becomes the new boundary for the region. A new candidate sample is taken uniformly. The process repeats until the candidate sample is within the slice. (See diagram for a visual example).