From andy_liaw at merck.com  Thu Jan  5 18:10:48 2006
From: andy_liaw at merck.com (Liaw, Andy)
Date: Thu, 5 Jan 2006 12:10:48 -0500
Subject: [Rd] random seed question
Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED6C4@usctmx1106.merck.com>

Just one call to each that enclose the RNG calls will do, I believe.

Andy

From: Tib
> 
> Greetings,
> 
> I am trying to write a C++ subroutine of my random number 
> generator. Based
> on tutorial in Writing R Extensions, one should call 
> GetRNGstate() before
> and PutRNGstate() after calling  R's random variate 
> generation routines. Now
> suppose my function would generate n(n>1) numbers by a loop, 
> do I need to
> call these two functions at each iteration? This certainly increases
> computation burden (although indiscernible in my case). But 
> if I only call
> them once (outside the loop), will the quality of my random numbers be
> reduced because of serial correlations in RNG algorithms? I 
> do comparisons
> between two methods, no significant difference is found. How 
> do you guys
> write RNG functions? Any other specific reasons? Thanks,
> 
> --
> I am Tib, not Rob.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>



[Rd] random seed question
Liaw, Andy