Random-Walk Metropolis (MCMC) Java Applet
This applet runs a simple random-walk Metropolis MCMC algorithm on a
simple target distribution consisting of just a few points. The blue
bars represent the target distribution; the black bars represent the
chain's empirical distribution. Over time, the black bars should
converge in height to the blue bars.
The applet accepts the following keyboard inputs. (You may need to
"click" on the applet first.)
-
Use the numbers '0' though '9' to set the animation speed level higher
or lower.
-
Use 'r' to restart the simulation, or 'z' to just zero the empirical count,
or 's' to toggle whether to show the empirical distribution.
-
Use '>' and '<' to increase/decrease the target probability of state 2
(and restart the simulation).
-
Use '+' and '-' to increase/decrease the number of states (and restart
the simulation).
-
Use 'p' and 'm' to increase/decrease the current value of gamma, the
spread of the (uniform) proposal distribution.
Applet by Jeffrey S. Rosenthal
(contact me).
[Return to my Applets Page / Home
Page]