[Rd] Seeding non-R RNG with numbers from R's RNG stream
Tommy Jones
jone@@tho@@w @end|ng |rom gm@||@com
Fri Jul 31 06:22:30 CEST 2020
Abby, that is a fantastic suggestion! It seems obvious now that you've said
it. Why didn't I think of that?
Thank you,
Tommy
On Fri, Jul 31, 2020 at 12:01 AM Abby Spurdle <spurdle.a using gmail.com> wrote:
> > 3. In C++: Draw millions of times from a Categorical(p) distribution,
> where
> > "p" is recalculated after each draw
>
> I don't see the need here.
> It should be possible to generate all the random numbers , *in R*, and
> in *one line* of R code.
> Easy...
>
> Then standard inversion sampling, can be used to transform the random
> numbers, as necessary.
> This may (?) benefit from a C/C++ implementation, but that can be kept
> separate from the random number generation.
> i.e. The C++ function takes a vector of random numbers from a uniform
> distribution, then computes "draws" (from the desired distribution),
> iteratively.
>
[[alternative HTML version deleted]]
More information about the R-devel
mailing list