Suppose I have a target distribution $\pi(\theta|x) \propto P(x|\theta)P_{\theta}(\theta)$ (e.g. the unnormalized posterior). I would like to use rejection sampling to obtain many samples $\{\theta_i\}$ from the posterior. Rejection sampling requires the use of a proposal distribution, $g(\theta)$, such that $c \cdot g(\theta) \geq \pi(\theta|x), \ \forall \ \theta$ (so $c\cdot g(\theta)$ envelopes the unnormalized posterior).
My question is: Can I get samples from $\pi(\theta|x)$ by setting $g(\theta) = P_{\theta}(\theta)$? In other words, can my proposal distribution be my prior (times a constant), which I then compare to the likelihood $P(x|\theta)$? e.g. my proposed algorithm is as follows:
- Sample $\theta_i$ from $P_\theta(\theta)$
- Sample $U_i$ from $Unif(0,1)$
- If $U_i \cdot (C \cdot P_\theta(\theta_i)) \leq P(x|\theta_i)$, accept $\theta_i$. Otherwise reject.
- Repeat many times
Will the resulting samples follow the posterior $\pi(\theta|x)$? Thank you!