Metropolis Algorithm javascript program, by Jeffrey Rosenthal. Description at the bottom.
This program displays a Metropolis algorithm on a very simple target distribution, with possible annealing or adapting. The target density is shown in blue, the empirical density in black, and the annealing (powered) target in green. Keyboard shortcuts (you might need to click on the canvas first): '0-9' to change the simulation speed ('1' for one-step-at-a-time), or 'f' or 's' or 'o' for faster/slower/one; 'r' to restart the simulation, or 'z' to just zero the counts; 'g' to generate a new random target, or 'x' to cycle between example targets; 'p' or 'm' to increase/decrease the proposal radius; '+' or '-' to increase/decrease the number of states; 'q' or 'w' to force a move to the left/right; 'e' to show/hide the empirical, or 'a' to start/stop annealing, or 'd' to start/stop adapting. It may be cited as: J.S. Rosenthal (2020), Metropolis Algorithm javascript program. Available at: probability.ca/met This program is written by Jeffrey Rosenthal. See also my other JavaScript, my Stochastic Processes book, and my Java Applets.
This program displays a Metropolis algorithm on a very simple target distribution, with possible annealing or adapting. The target density is shown in blue, the empirical density in black, and the annealing (powered) target in green. Keyboard shortcuts (you might need to click on the canvas first):
This program is written by Jeffrey Rosenthal. See also my other JavaScript, my Stochastic Processes book, and my Java Applets.