This is a program to generate samples from standard normal distribution using Metropolis algorithm. The proposal distribution used here is uniform distribution between x-1 and x+1.

Here we sample only one number from each chain, which is the number at the final step. Therefore you should enter the number of samples you want in "The number of chains".

View page source

Acknowledgement: The histogram function was written by Ke Yang.

Haihong Li

haihong@stat.psu.edu