A Simple Guided Random Walk

The Metropolis algorithm allows to generate a series of states (or points in phase space if given a function of space coordinates) distributed according to a given probability weight function. This is illustrated in this section by generating a guided random walk based on the following probability profile:


\begin{displaymath}P(r) = r^2 \exp{( - r^2 )} \end{displaymath}

where

\begin{displaymath}r( x, y ) = \sqrt{ x^2 + y^2 } \end{displaymath}

is the distance from the origin. This is a gaussian with a hole punched out in its center. Load the following in Maple: Probability_profile.mw . This weight function is simple yet it is difficult to generate random points corresponding to it directly. Therefore, we use the Metropolis algorithm to find sampling points in the $x - y$ plane according to the probability profile $P(r)$.

The program guided_walk.c generates the random walk starting from an arbitrary location in the plane. It implements the Metropolis algorithm to generate the random steps based on the given probability weight function. Note that the latter does no need to be normalized for the Metropolis algorithm to work. This turns out to be a huge advantage of the method.

Use GNUPLOT to plot the location of the steps. Note that the points seem to be more numerous within the annulus as specified by the probability weight function $P(r)$.

It is instructive to check the probability distribution of those generated steps as compared to the requested probability weight function. This requires calculating the density of points in the $x - y$ plane. A convenient way to bin the points is via a set of concentric rings of equal areas centered onto the origin. This is so because the probability profile is axially symmetric. The number of points in each ring should follow the probability weight function. The program check_radial.c bins the random steps according to the ring they belong to as given by their distances from the origin. It generates a table to be used in a histogram plot. A subtle point has to be taken into account in displaying the bin contents at distances between the boundaries of the rings. They should be posted at a radius such that it divides the rings in equal ( half ) areas on each sides.

It is also interesting to analyze the capability of the Metropolis algorithm to generate random points exhibiting the axial symmetry of the probability weight function. The program check_centroid.c calculates the center of mass of those points. It should be at (0,0). The distance from the origin is an elementary measure of the lack of quality of the random steps.

We can also calculate the axial distribution of the random steps. This is accomplished by calculating the number of points in wedges of equal areas centered onto the origin. The program check_angular.c calculates the data to plot this histogram.

Use 3,000 steps and 50,000 steps to develop an intuition about the Metropolis algorithm by comparing the results.

The Metropolis algorithm guides the random walk to generate a radial profile that is quite accurate. The angular profile, on the other hand, is not so accurate. This is because the probability profile has a localized radial dependence which is very effective in guiding the random walk. This is not the case in the angular direction since the probability profile is a constant in this direction due to its axial symmetry.

The guided_walk.c code uses an arbitrary step size, yielding a somewhat large acceptance ratio. The effectiveness of the Metropolis algorithm certainly depends on this step size. This should be investigated. The step size should be added to the line arguments list in the code to simplify this analysis.

Michel Vallieres 2014-04-01