0

I am coding using C/C++, and try to do sampling with replacement based on the sampling probability.

Considering the running performance, I try to use Intel MKL. However, I only find random sampling without replacement https://software.intel.com/en-us/node/536468. I did not find random sampling with replacement. To get random sampling with replacement, I can call random sampling without replacement many times and get only one sample each time, which I think may run a bit slowly.

Then, is there 'random sampling with replacement' in MKL? or other strategy can fast run 'random sampling with replacement'?

All experiments are done in only one thread.

olivia
  • 381
  • 3
  • 14
  • Can you give more detail about the problem you are trying to solve: population size, sample size, time constraints and so on? – cenouro Nov 21 '16 at 08:47
  • @cenouro Thanks. Just want it to run fast. The population size is about 10^8. – olivia Nov 21 '16 at 08:50
  • What about the sample sizes? – cenouro Nov 21 '16 at 08:57
  • @cenouro The sample size ranges from 1 to population size. – olivia Nov 21 '16 at 09:00
  • Can you edit your question and include your code so far? A lot of the article you linked deals with performance issues that arise from *not* being able to reuse the same sampled number (for example, the Integer Scaling step and Fisher-Yates shuffle algorithm). Your case should be simpler. – cenouro Nov 21 '16 at 09:34

0 Answers0