Proof of Rejection Sampling
In previous post, I introduced the simple idea of rejection sampling algorithm. But the step 2 (Accept the sample with a probability ()) should be elaborated when you actually use it.
- Draw a sample from G (which is a known distribution that you already know how to draw samples from)
- Draw a sample from uniform distribution (U) and accept it when is true. Otherwise, reject it.
- Repeat 1 and 2 util the sample’s probability distribution is close enough to the target.
: a random variable whose probability density function(pdf) is , which we want to draw samples.
: a probability distribution of
: a random variable whose pdf is
: a probability distribution of
: a constant value which meets and for all
I’m providing the proof that the sample’s probability distribution is equal to the target probability distribution, which is.
Let’s start the proof:
(Bayes' theorem)
We need and .
1. can be transformed as follows:
( is a pdf of joint distribution of )
(Bayes' theorem for pdf and g(x) is a pdf of G)
( because we accept a sample from G with with a probability ()
2. can be transformed as follows: (Please refer this for details)
As a result of 1 and 2, we can get the following result:
Basically I refer to the following article:
monte carlo - How does the proof of Rejection Sampling make sense? - Cross Validated