if the proposal transition density is symmetric (that isq( xq( ))then the acceptance probability has the simple form (ya(xymin , ( (xrandom walk sampler and the mcmc algorithm is called random walk sampler typical example is whenfor given current state xthe proposal state is of the form zwhere is generated from some spherically symmetric distributionsuch as ( iwe now give an example illustrating the second approach example (random walk samplerconsider the two-dimensional pdf + ( sin - - ( where is an unknown normalization constant the graph of this pdf (unnormalizedis depicted in the left panel of figure - - - - - - figure left panelthe two-dimensional target pdf right panelpoints from the random walk sampler are approximately distributed according to the target pdf the following python program implements random walk sampler to (approximatelydraw dependent samples from the pdf at each stepgiven current state xa proposal is drawn from the (xidistribution that isy zwith bivariate standard normal we see in the right panel of figure that the sampler works correctly the starting point for the markov chain is chosen as ( note that the normalization constant is never required to be specified in the program rwsamp py import numpy as np import matplotlib pyplot as plt from numpy import pi exp sqrt sin from numpy random import rand randn