[SciPy-User] random points within an ellipse
Tue Aug 10 13:17:29 CDT 2010
On Tue, Aug 10, 2010 at 2:08 PM, nicky van foreest <firstname.lastname@example.org> wrote:
> Thanks for the nice feedback.
> This is a bit too short for me:
>> I would oversample if the rejection rate is around 20%
> BTW: The rejection fraction of an ellipse is 1 - \pi/4 \approx 0.21.
> What is wrong with using the rejection method?
Everything is fine.
I meant that in Erin's code the exact number of still missing random
variables are drawn in each iteration.
So it will take many iterations, with smaller and smaller sample sizes
to get to the desired number.
If instead 20% more random variables are drawn in each iteration, then
in expected terms only one iteration would be needed. Of course
actually there will still be too few or already too many. Getting an
extra random draw from numpy is cheap, I guess.
> SciPy-User mailing list
More information about the SciPy-User