4 ms·
> ...numericists don't like the throwing away bit... Although in 2 dimensions (setting of OP), this isn't that bad (you waste a proportion of (1-pi/4), or 21%,
by mturmon 2y ago
> ...numericists don't like the throwing away bit...
Although in 2 dimensions (setting of OP), this isn't that bad (you waste a proportion of (1-pi/4), or 21%, of your samples) -- perhaps 21% might be worth worrying about for some applications.
Of course, it gets much worse in higher dimensions, because the unit ball is much smaller than the unit cube there.
- mattkrause 2y agoThis obviously depends on a million other factors too (implementation, language, architecture, etc) but I've benchmarked this a few times and, at least for naive implementations in 2D/3D, rejection sampling was often faster.