- Slice sampling
In
mathematics andphysics , Slice sampling is a type ofMarkov chain Monte Carlo samplingalgorithm based on the observation that to sample arandom variable one can sample uniformly from the region under the graph of its density function.Implementation
To sample a random variable "X" with density we introduce an auxiliary variable and iterate as follows: Given a sample "x" we choose "y" uniformly at random from the interval ; given "y" we choose "x" uniformly at random from the set . The sample of "x" is obtained by ignoring the "y" values.
Example
To sample from the
normal distribution we first choose an initial "x" -- say 0. After each sample of "x" we choose "y" uniformly at random from ; after each "y" sample we choose "x" uniformly at random from where .An implementation in the
Macsyma language is:See also
*
Sampling (statistics)
*Markov chain Monte Carlo References
* Radford M. Neal, "Slice Sampling". "The Annals of Statistics", 31(3):705-767, 2003.
Wikimedia Foundation. 2010.