search for: comparesampletimes

Displaying 1 result from an estimated 1 matches for "comparesampletimes".

2015 Sep 09
0
sample.int() algorithms
...But I'm not sure why the "n > 1e7" check is needed. I put together some sample code to show the difference in timing letting sample.int() choose the cutoff point versus manually specifying the use of do_sample2(): ### compare times for sample.int() vs internal function sample2() compareSampleTimes = function(popSizeList=c(1e5, 1e6, 1e7, 1e8, 1e9), sampleSizeList=c(10, 100, 1000, 10000), numReplications=1000) { for (sampleSize in sampleSizeList) { for (popSize in popSizeList) { elapsed1 = system.time(replicate(numReplications, sample.int(popSize, sampleSize)))...