Accept-Reject intuitive description.
Suppose we have an area \(\Omega'\) completely enclosed by another area \(\Omega\) as seen below. We know how to sample from the larger area \(\Omega\) but we really want to sample from \(\Omega'\).
We can do this via the Accept-Reject algorithm as follows:
Let
\(g(x) = \frac{\mathbb{1}_\Omega
(x)}{A(\Omega)}\) where we have an indicator for in/out of \(\Omega\) and A is the area defined by \(\Omega\).
Similarly, we define our target by:
\(f(x) = \frac{\mathbb{1}_\Omega'
(x)}{A(\Omega')}\)
The AR algorithm is then:
Darts to estimate \(\pi\).
Consider a circle circumscribed within the bounds of the square, both centered on (x,y)=(0,0). Let the radius of the circle be 1 such that if we focus on the first quadrant, we are looking at a unit square. Within this quadrant, we can form the ratio of the areas as:
\[ \begin{equation} \frac{\tfrac{1}{4}A_{circle}}{A_{square}} = \frac{\pi r^2}{4r^2} = \frac{\pi}{4} \end{equation} \] So, if we could measure the area of the circle vs square in this quadrant, we know the ratio will be \(\frac{\pi}{4}\). So, how can we determine the areas? How about we sample from the unit square and perform accept-reject if the points samples fall within the circle?
If you see mistakes or want to suggest changes, please create an issue on the source repository.
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/rsettlage/rsettlage.github.io, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Settlage (2022, June 4). Robert E. Settlage: Accept-Reject-digression-tldr. Retrieved from https://rsettlage.github.io/mcmc/2022-06-13-ar-digression-tldr/
BibTeX citation
@misc{settlage2022accept-reject-digression-tldr, author = {Settlage, Robert}, title = {Robert E. Settlage: Accept-Reject-digression-tldr}, url = {https://rsettlage.github.io/mcmc/2022-06-13-ar-digression-tldr/}, year = {2022} }