Skip to content
Prev 16698 / 63424 Next

efficiency of sample() with prob.

You might recall the message

     R is a collaborative project with many contributors.

We suggest that you take up your own suggestion, research this area and 
offer the R project the results of your research for consideration as your 
contribution.

It seems likely that in sample(x, size, replace = TRUE, prob) the optimal 
method depends on both the size of 'x' and 'size' and perhaps to a lesser 
extent on 'prob'.  (That's what my book on the subject shows.)
On Wed, 22 Jun 2005, Bo Peng wrote:

            
Quicker than what?  See the discussion in my Stochastic Simulation book 
for `quicker than Walker'.