Here is a simulation of a one-dimensional "slice sampler" Markov chain. The target (stationary) distribution has density proportional to exp(-x^a). Initially a=1, but this can be changed (see below).
See the chain run! The green dot shows the current position of the chain; the green line connects the previous position to the current position. The chain proceeds by alternately updating the x and y coordinates, uniformly from all choices which remain underneath the (blue) graph of the target function.
With a=1, the target is a standard Exp(1) distribution, so the mean should be (gradually!) converging to 1. For larger values of a, the convergence should be at least as good. But note that for very small values of a, the sampler is much less stable.
The applet accepts the following keyboard inputs. (You may need to "click" on the applet first.)
For further discussion of slice samplers and auxiliary variable techniques, see the following recent papers: