similar to: [R] RNG Cycle and Duplication (PR#12540)

Displaying 20 results from an estimated 1000 matches similar to: "[R] RNG Cycle and Duplication (PR#12540)"

2008 Aug 17
1
Wichmann-Hill Random Number Generator and the Birthday Problem
Dear all, Recently I am generating large random samples (10M) and any duplicated numbers are not desired. We tried several RNGs in R and found Wichmann-Hill did not produce duplications. The duplication problem is the interesting birthday problem. If there are M possible numbers, randomly draw N numbers from them, the average number of dupilcations D = N(N-1)/2/M. For Knuth-TAOCP and
2008 Aug 14
2
RNG Cycle and Duplication
Hello all, I am generating large samples of random numbers. The RNG help page says: "All the supplied uniform generators return 32-bit integer values that are converted to doubles, so they take at most 2^32 distinct values and long runs will return duplicated values." But I find that the cycles are not the same as the 32-bit integer. My test indicated that the cycles for
2019 Feb 26
2
bias issue in sample() (PR 17494)
Gabe As mentioned on Twitter, I think the following behavior should be fixed as part of the upcoming changes: R.version.string ## [1] "R Under development (unstable) (2019-02-25 r76160)" .Machine$double.digits ## [1] 53 set.seed(123) RNGkind() ## [1] "Mersenne-Twister" "Inversion"??????? "Rejection" length(table(runif(1e6))) ## [1] 999863 I don't
2019 Feb 26
1
bias issue in sample() (PR 17494)
Ralf I don't doubt this is expected with the current implementation, I doubt the implementation is desirable. Suggesting to turn this to pbirthday(1e6, classes = 2^53) ## [1] 5.550956e-05 (which is still non-zero, but much less likely to cause confusion.) Best regards Kirill On 26.02.19 10:18, Ralf Stubner wrote: > Kirill, > > I think some level of collision is actually
1999 Apr 28
1
R random number generator
R 0.64 on windows NT 4.0 Sometimes I got an error message by doing this > .Random.seed <- c(1, 1:2) > .Random.seed [1] 1 1 2 > runif(5) Warning: Wrong length .Random.seed; forgot initial RNGkind? set to Wichmann-Hill[1] 0.02253721 0.84832584 ........ Sometimes I do not get error message: > .Random.seed <- c(1, 1:2) > .Random.seed [1] 1 1 2 > runif(1) [1] 0.5641106 >
2003 Oct 20
1
Random Number Generator RNGkind() under "R CMD check" (PR#4691)
Full_Name: Wolfgang Huber Version: 1.8.0 OS: Linux Submission from: (NULL) (193.174.58.146) The man page for RNGkind says that the default is Mersenne-Twister, and when I start R interactively, I get in fact > RNGkind() [1] "Mersenne-Twister" "Inversion" However, during the execution of "R CMD check" I get > > ### ** Examples > > > > RNGkind()
2005 Nov 17
2
R questions
Dear Sir/Madam, I am a beginner in R. Here is my questions. 1. Can you give me one test for randomness (a name and descriptive paragraph is sufficient). 2. I have learned a uniform random number generator [e.g. not the algorithms: i)Wichmann-Hill, ii) Marsaglia-Multicarry, iii) Super-Duper (Marsaglia), iv) Mersenne-Twister, v) TAOCP-1997 (Knuth), or vi) TAOCP-2002 (Knuth)] . Is there any other
1999 May 05
1
RNG R/Splus compatibility
Starting with example Wichmann-Hill code from Brian Ripley I have been playing with a set of programs for getting the same random sequences from R and Splus. A copy is included below along with a test (which works in Solaris with R and Splus 3.3). The approach is somewhat different from the usual problems on this list as I am trying to get the same results from Splus as I get from R. However,
2008 Mar 14
1
Buggy Kinderman-Ramage (PR#2846)
Unfortunately, RNGkind is buggy. It will not generate warnings except the full name "Buggy Kinderman-Ramage" is supplied for normal.kind. match.arg is supposed to be called before "==" comparison. ======================================== Shengqiao Li Research Associate The Department of Statistics PO Box 6330 West Virginia University Morgantown, WV 26506-6330
2000 Feb 22
2
reproducing Box-Muller numbers
There seems to be a minor problem with reproducing numbers from rnorm with Box-Muller. The pattern suggests it might have something to do with the value that gets dropped when an odd number of numbers is requested. (Details below.) Also, could "user-supplied" be added as an option for normal.kind in RNGkind. I'm sure the Box-Muller in R is better than my own attempt, but I would
2019 Feb 19
2
bias issue in sample() (PR 17494)
Before the next release we really should to sort out the bias issue in sample() reported by Ottoboni and Stark in https://www.stat.berkeley.edu/~stark/Preprints/r-random-issues.pdf and filed aa a bug report by Duncan Murdoch at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17494. Here are two examples of bad behavior through current R-devel: set.seed(123) m <- (2/5) * 2^32
1999 May 04
1
rnorm
Brian I've been playing a bit with the Wichmann-Hill RNG. I would prefer to have normally distributed random numbers and I think I have things generally worked out to use Wichmann-Hill and then Box-Muller. In the process, I was looking at R's rnorm.c, but could not figure out what transformation is used in R to convert uniform rv's to normal rv's. Do you know? It looks like there
2019 Feb 26
0
bias issue in sample() (PR 17494)
Kirill, I think some level of collision is actually expected! R uses a 32bit MT that can produce 2^32 different doubles. The probability for a collision within a million draws is > pbirthday(1e6, classes = 2^32) [1] 1 Greetings Ralf On 26.02.19 07:06, Kirill M?ller wrote: > Gabe > > > As mentioned on Twitter, I think the following behavior should be fixed > as part of the
2017 Nov 03
5
Extreme bunching of random values from runif with Mersenne-Twister seed
This is cross-posted from SO (https://stackoverflow.com/q/47079702/1414455), but I now feel that this needs someone from R-Devel to help understand why this is happening. We are facing a weird situation in our code when using R's [`runif`][1] and setting seed with `set.seed` with the `kind = NULL` option (which resolves, unless I am mistaken, to `kind = "default"`; the default being
2009 Nov 16
2
(Parallel) Random number seed question...
Hi All, I have k identical parallel pieces of code running, each using n.rand random numbers.? I would like to use the same RNG (for now), and set the seeds so that I can guarantee that there are no overlaps in the random numbers sampled by the k pieces of code.? Another side goal is to have reproducibility of my results.? In?the past I have used C with SPRNG for this task, but I'm hoping
2008 Aug 14
0
[R] RNG Cycle and Duplication (PR#12538)
Shengqiao Li wrote: > Hello all, > > I am generating large samples of random numbers. The RNG help page says: > "All the supplied uniform generators return 32-bit integer values that are > converted to doubles, so they take at most 2^32 distinct values and long > runs will return duplicated values." But I find that the cycles are not > the same as the 32-bit
2002 Nov 26
5
unexpected behaviour of rnorm()
Hello everyone. If I do f <- function(n){max(rnorm(n))} plot(sapply(rep(5000,4000),f)) #[this takes my PC about 30 seconds] then I get something quite unexpected: gaps in the distribution. For me, the most noticable one is at about 3.6. Do others get this? Is it an optical illusion? It can't be right, can it? Or maybe I just don't understand the good ol' Gaussian very
1998 Dec 01
0
Random Number Generators, .Random.seed and all that..
As some of you know, we have been thinking of allowing the possibility of a CHOICE of the kind of random number generator (=: RNG) to use in R. The current R-release snapshot even has some code in it; however, this will be changed quite a bit. Here is a kind of informal RFC (request for comments / request for criticism / ..): 1a. With the new scheme, we still want that save(..) &
2002 Mar 01
2
Weakness in Knuth-TAOCP RNG (fwd) (PR#1336)
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1141662977-1014960253=:3119 Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID:
2017 Nov 03
1
Extreme bunching of random values from runif with Mersenne-Twister seed
Martin, Thanks for the helpful reply. Alas I had forgotten that (implied) unfavorable comparisons of *nix systems with Windows systems would likely draw irate (but always substantive) responses on the R-devel list -- poor phrasing on my part. :) Regardless, let me try to address some of the concerns related to the construction of the MRE itself and try to see if we can clean away the shrubbery