search for: universesize

Displaying 2 results from an estimated 2 matches for "universesize".

2004 Sep 24
1
algorithm reference for sample()
...Don't know if it belongs to r-devel or r-help, but since I am planning to alter some of R's internal code I am sending it here. The existing implementation of the sample() function, when the optional 'prob' argument is given, is quite inefficient. The complexity is O(sampleSize * universeSize), see ProbSampleReplace() and ProbSampleNoReplace() in random.c. This makes the function impractical for the vector sizes I use. I want to re-code these functions and I "think" I can come up with a more efficient algorithm. However before I go and reinvent the wheel I wonder if there is...
2004 Sep 24
1
algorithm reference for sample() - Knuth
...ce I > am planning > >to alter some of R's internal code I am sending it here. > > > >The existing implementation of the sample() function, when > the optional > >'prob' argument is given, is quite inefficient. The complexity is > >O(sampleSize * universeSize), see ProbSampleReplace() and > >ProbSampleNoReplace() in random.c. This makes the function > impractical > >for the vector sizes I use. I want to re-code these functions and I > >"think" I can come up with a more efficient algorithm. > However before I >...