Slice sampling: Difference between revisions

Content deleted Content added
m Example: Missing word
Example: +exposition
Line 107:
#Now, each endpoint of this area is tested to see if it lies outside the given slice. Our right bound lies outside our slice (f(3) = ~0.0807 < 0.1), but the left value does not (f(1) = ~0.1258 > 0.1). We expand the left bound by adding ''w'' to it until it extends past the limit of the slice. After this process, the new bounds of our region of interest are (-3,3).
#Next, we take a uniform sample within (-3,3). Suppose this sample yields x = -2.9. Though this sample is within our region of interest, it does not lie within our slice (f(2.9 = ~0.08334 < 0.1), so we modify the left bound of our region of interest to this point. Now we take a uniform sample from (-2.9, 3). Suppose this time our sample yields x = 1, which is within our slice, and thus is the accepted sample output by slice sampling. Had our new ''x'' not been within our slice, we would continue the shrinking/resampling process until a valid ''x'' within bounds is found.
 
If we're interested in the peak of the distribution, we can keep repeating this process since the new point corresponds to a higher f(x) than the original point.
 
==Another Example==