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).

[Oops, your browser will not display java applets.]

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.)

Slice samplers are an interesting way to simulate from a distribution, by sampling uniformly from the region underneath the graph of the density function. In general the samplers are multi-dimensional, perhaps with multiple auxiliary variables -- but this applet treats the one-dimensional case only.

For further discussion of slice samplers and auxiliary variable techniques, see the following recent papers:

Note: Many of these and other papers are available from the MCMC Preprint Service.

Applet by Jeffrey S. Rosenthal (contact me).

[Return to my Applets Page / Home Page]