I have a non-uniform distribution over a unit circle, peaking at $\frac{3}{\pi}$ at $(0,0)$ and tailing away to zero at the edge,
$f(x,y) = \frac{3}{\pi} \cdot (1 – \sqrt{x^2+y^2})$
I wish to generate a few random points within the unit circle according to this distribution.
Is there a straightforward method?
Best Answer
Probably the easiest to implement would be rejection sampling. A simple implementation would be as follows.
Let $\mu = \max_{(x,y) \in [0,1]^2} f(x,y) = \frac3{\pi}$.
To see why this works you will want to read the wikipedia page cited above (or another source).
Example Implementation in R