Fact Gibbs sampler requires simulation from the full conditional distributions for all . As before these may not be available. Instead of sampling from ,
we can sample from where is easy to sample from, then decide whether to accept sample as next point in Markov chain simulation, or to stay at the current point.
AlgorithmMetropolis-Hastings Sampler
For any proposed distribution such that the Markov chain is still -irreducible and aperiodic:
Initialize parameter vector . Set .
Generate proposed point
Generate . If wherethen accept . Else .
Increment and repeat the above.
ThrmDetailed Balance
Suppose is a transition density for a given . Then a that satisfies the reversibility condition:has as its invariant distribution.
M-H Special Cases
DefRandom Walk Metropolis Sampler
If for some arbitrary density then the M-H algorithm is a random walk aswe call it random walk metropolis sampler.