Hello, I'm running R 2.10.1 on Windows Vista. I'm selecting a random sample of several hundred items out of a larger population of several thousand. I realize there is srswor() in package sampling for exactly this purpose, but as far as I can tell it uses the native PRNG which may or may not be random enough. Instead I used the random package which pulls random numbers from random.org, although in my extended reading [vignette("random-intro", package="random")] it seem like that may have problems also. I'm curious what the general consensus is for random number quality for both the native built-in PRNG and any alternatives including the random package. Thanks, Ben K. [[alternative HTML version deleted]]
> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of b k > Sent: Friday, February 05, 2010 2:04 PM > To: r-help at r-project.org > Subject: [R] Random number quality > > Hello, > > I'm running R 2.10.1 on Windows Vista. I'm selecting a random sample of > several hundred items out of a larger population of several thousand. I > realize there is srswor() in package sampling for exactly this purpose, > but > as far as I can tell it uses the native PRNG which may or may not be > random > enough. Instead I used the random package which pulls random numbers from > random.org, although in my extended reading [vignette("random-intro", > package="random")] it seem like that may have problems also. > > I'm curious what the general consensus is for random number quality for > both > the native built-in PRNG and any alternatives including the random > package. > > Thanks, > Ben K. >Without knowing what criteria/methods you would use to decide on "random enough", I would still say the default PRNG in R is more than adequate for your described application. Dan Daniel Nordlund Bothell, WA USA
A couple comments. Although pseudo-random numbers were originally used because of necessity rather than choice, there is a definite upside to using them. That upside is that the computations become reproducible if you set the seed first (see 'set.seed'). I tend to encourage skepticism at pretty much every turn. But I find this piece of skepticism a bit misplaced. The application that you describe does not sound at all demanding, and R Core is populated by some of the best statistical computing people in the world. On 05/02/2010 22:04, b k wrote:> Hello, > > I'm running R 2.10.1 on Windows Vista. I'm selecting a random sample of > several hundred items out of a larger population of several thousand. I > realize there is srswor() in package sampling for exactly this purpose, but > as far as I can tell it uses the native PRNG which may or may not be random > enough. Instead I used the random package which pulls random numbers from > random.org, although in my extended reading [vignette("random-intro", > package="random")] it seem like that may have problems also. > > I'm curious what the general consensus is for random number quality for both > the native built-in PRNG and any alternatives including the random package. > > Thanks, > Ben K. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Patrick Burns pburns at pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User')