Here is a simulation of a onedimensional "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.)

Use 'f' and 's' to make the chain run faster or slower.

Use 'r' to restart the simulation.

Use '+' and '' to modify the value of the exponent a (and
restart).

Use 't' to toggle on/off the displaying of the proposal line (in white)
before each move.
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 multidimensional,
perhaps with multiple auxiliary variables  but this applet treats
the onedimensional 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]