March 30, 2017---Class 22---Metropolis Method, Autocorrelations,
Shell Scripts for Metropolis Method
Activities:
Metropolis Method
-----------------
Another interesting method was developed by Metropolis, Rosenbluth,
Rosenbluth, Teller and Teller. It can be used to generate a random
walk that has the desired probability distibution. The key idea is
that we take the current value of x, take a random trial step, and then
test the new point's probability. If it is more probable, we accept
the new point. If it less probable, we accept it with probability
p(x_trial)/p(x). I showed the class a C code that accomplishes this.
The method is discussed in CSM section 11.7, starting on page 435.
The Metropolis method is regarded as one of the 10 greatest numerical
methods developed in the 20th century. It's use is quite widespread.
It is not a particularly good method for generating gaussian random
numbers, but we can learn a lot about the method, its efficiency and
data analysis by studing the method in this very simple context.
I displayed the code to implement the metropolis method. Read the
appendix in CSM to see how
detailed balance is achieved by the algorithm. Because this is such
an important method, it is important for me that you implement it
yourself on the next homework assignment.
Let's explore the efficiency of this method which often
goes by the name Monte Carlo because of the prominence of random
numbers.
Metropolis Optimization
-----------------------
Time history, histogram
I created some numbers with the command
metropolis 1 5000 0.2 >data
This should create a run with 5000 numbers of a Gaussian with width
1. A maximum step size of +- 0.2 is used.
Create the time history with the command
axis a