This program runs a random-scan component-wise Metropolis MCMC algorithm on a spatial point process hardcore model for a fixed number of particles, with initial distribution uniform over the pink region, and with target density (with respect to uniform) proportional to exp(-H), where

H(z_1, z_2, ..., z_N) = A * sum_{i<j} |z_i − z_j| + B * sum_{i<j} (1 / |z_i − z_j|) + C * sum_i (z_i1)where |...| is Euclidean distance, z_i is the position of the i'th particle, and z_i1 is the first coordinate of z_i.

The program accepts the following keyboard inputs (or you can mouse click):

- Use the numbers
**'0'**though**'9'**to set the animation speed level higher or lower. (Note that 0=frozen, and 1=one-step. Alternatively, use**'f'**or**'s'**or**'o'**for faster/slower/one.) - Use
**'A'**and**'a'**to increase/decrease the value of A, and similarly**'B'**and**'b'**for B, and**'C'**and**'c'**for C. (Yes, negative values are allowed.) - Use
**'r'**to restart the simulation, or**'z'**to just zero the counts. (The initial distribution is always independent uniform placement.) - Use
**'p'**and**'m'**to increase/decrease the size sigma of the proposal increments. - Use
**'+'**and**'−'**to increase/decrease the number N of particles (and restart the simulation). - Use
**'t'**to toggle between (S)ystematic or (R)andom scan type.

This program is written by Jeffrey Rosenthal. See also my other JavaScript, my Stochastic Processes book, and my Java Applets.