9.5 Rejection sampling

9.5.1 Description

An important method which does not make use of Markov chain methods but which helps to introduce the Metropolis–Hastings algorithm is rejection sampling or acceptance-rejection sampling. This is a method for use in connection with a density  in the case where the normalizing constant K is quite possibly unknown, which, as remarked at the beginning of this chapter, is a typical situation occurring in connection with posterior distributions in Bayesian statistics. To use this method, we need to assume that there is a candidate density  from which we can simulate samples and a constant c such that  . Then, to obtain a random variable  with density  we proceed as follows:

1. Generate a variate Y from the density  ;
2. Generate a value  which is uniformly ...

Get Bayesian Statistics: An Introduction, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.