Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTimXV=VKt3BCi_A-ry4yaPM3RsRVqw@mail.gmail.com>
Date: 2011-05-14T21:33:52Z
From: Douglas Bates
Subject: [Rcpp-devel] Rcpp equivalent of sample()?

You can check what is done in R itself in the R sources but I imagine that
it uses a uniform random variate converted to an integer through the
cumulative probabilities. The good news is that it is easy to create the
cumulative weights with the std::accumulate function.
On May 14, 2011 4:12 PM, "Chris DuBois" <chris.dubois at gmail.com> wrote:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110514/f41295a0/attachment-0001.htm>