search for: rngkind

Displaying 20 results from an estimated 100 matches for "rngkind".

2008 Aug 17
1
Wichmann-Hill Random Number Generator and the Birthday Problem
...5e7. But in my tests, duplications were surprisingly not observed. It seems that Wichmann-Hill has a much larger cycle than the one documented! Anybody can solve this puzzle? Regards, Shengqiao Li Department of Statistics West Virgina Unversity ==============Testing=================== > RNGkind(kind="Knuth-TAOCP"); > RNGkind(); [1] "Knuth-TAOCP" "Inversion" > sum(duplicated(runif(1e7))); [1] 46216 > > RNGkind(kind="Knuth-TAOCP-2002"); > RNGkind(); [1] "Knuth-TAOCP-2002" "Inversion" > sum(duplicated(runif(1e7)));...
2008 Aug 19
1
RNGkind() state (PR#12567)
I sent this to R-devel early last month, but have received no response, so I guess it really is a bug. This looks like a bug to me, and is a bit hard to describe, but easy to reproduce. ? Basically, if RNGkind is saved as something other than the default, and if the first operation in a session is a set.seed(), the default is reverted to. ?Reproduce by: cafe-rozo> ?R --vanilla R version 2.7.1 (2008-06-23) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free so...
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() > [1] "Wi...
2008 Jul 07
0
RNGkind() state
This looks like a bug to me, and is a bit hard to describe, but easy to reproduce. Basically, if RNGkind is saved as something other than the default, and if the first operation in a session is a set.seed(), the default is reverted to. Reproduce by: cafe-rozo> R --vanilla R version 2.7.1 (2008-06-23) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free so...
1998 Dec 01
0
Random Number Generators, .Random.seed and all that..
...pshot 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(..) & load(..) restore the state of the RNG. The new state is [ RNGkind ; "seed" of that RNG ]. "seed" really means the state of the chosen RNG 1b. For compatibility reasons, it makes sense to keep this RNGstate in the integer vector .Random.seed. Before each RN generation, .Random.seed is read into the internal RNG stat...
2008 Aug 14
2
[R] RNG Cycle and Duplication (PR#12540)
...E-aware tools. ---559023410-851401618-1218751024=:15885 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE I didn't describe the problem clearly. It's about the number of distinct=20 values. So just ignore cycle issue. My tests were: RNGkind(kind=3D"Knuth-TAOCP"); sum(duplicated(runif(1e7))); #return 46552 RNGkind(kind=3D"Knuth-TAOCP-2002"); sum(duplicated(runif(1e7))); #return 46415 #These collision frequency suggested there were 2^30 distinct values by=20 birthday problem. RNGkind(kind=3D"Marsaglia-Multic...
1999 May 05
1
RNG R/Splus compatibility
...py 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, there are a couple of R issues: - There is a small change to RNGkind to allow "default" (currently Wichmann-Hill but could change from time to time). -The strategy for specifying the transformation to get rnorm results should be examined, as I think it should be put into R and extended for other random number transformations. Paul Gilbert ________ # F...
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 expect any collisions when using Mersenne-Twister to generate a million floating point values. I'm not sure what causes this behavior, but it's doc...
2000 Feb 21
1
RNGkind(kind="default", normal.kind="default")
I'm impressed with all the new options for RNG setting (although, I now have to re-work the way I was doing some of this). Would it be possible to add "default" as a legitimate value for kind and normal.kind in RNGkind and set.seed? This would be used to set things back to R's default settings (which may change from time to time with new versions). Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-...
2019 Feb 19
2
bias issue in sample() (PR 17494)
...ndex to address this by generating random bits (blocks of 16) and rejection sampling, but for now this is only enabled if the environment variable R_NEW_SAMPLE is set before the first call. Some things still needed: - someone to look over the change and see if there are any issues - adjustment of RNGkind to allowing the old behavior to be selected - make the new behavior the default - adjust documentation - ??? Unfortunately I don't have enough free cycles to do this, but I can help if someone else can take the lead. There are two other places I found that might suffer from the same issue, in...
2019 Feb 26
1
bias issue in sample() (PR 17494)
...d 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 expect any collisions when using Mersenne-Twister to generate a >> million floating point values. I'm n...
2019 Feb 26
0
bias issue in sample() (PR 17494)
...be > > > 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 expect any collisions when using Mersenne-Twister to generate a > million floating point values. I'm not sure what causes thi...
2006 Aug 31
1
Interface for package supplied random number generator
...m random number generators in R (see by article in R News 5/2, November 2005). There exists a mechanism called "user-supplied" that allows users of R to run their own generator in R. However, there is no such mechanism for package writers. Those who want to add their own generators abuse RNGkind(kind="user-supplied") for their purpose. The problem with this approach is that it relies on the unique existence of the function "user_unif_rand". When two packages are loaded that use this interface, then at least one package is broken. If the user herself loads a shared libra...
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
2000 Feb 22
2
reproducing Box-Muller numbers
...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 like to be able to reproduce results I've obtained in the past. Paul Gilbert ________ > .Random.seed <- c(200,979,1479,1542) > rnorm(5) [1] -1.9242522 -0.8956891 2.1221336 0.8166920 -0.1356919 > .Random...
2019 Feb 20
0
bias issue in sample() (PR 17494)
Luke, I'm happy to help with this. Its great to see this get tackled (I've cc'ed Kelli Ottoboni who helped flag this issue). I can prepare a patch for the RNGkind related stuff and the doc update. As for ???, what are your (and others') thoughts about the possibility of a) a reproducibility API which takes either an R version (or maybe alternatively a date) and sets the RNGkind to the default for that version/date, and/or b) that sessionInfo be modified...
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 > Not even this got error message sometimes > .Random.seed <- c(0, 1:2) > runif(1) [1] 0.03381877...
2003 Mar 03
0
R-devel RNG change
...en returns the state. The # rational is that querying the state is usually for the purpose of # reproducing it, so it must first be initialized to put it in a # reproducible state. if (!exists(".Random.seed")) z <- runif(1) old <- list(kind=RNGkind()[1],normal.kind=RNGkind()[2], seed=.Random.seed[-1]) if (is.null(kind) & is.null(seed) & is.null(normal.kind)) return (old) #kind can be a list as returned by a previous call to set.RNG if (is.list(kind)) {seed <- kind$seed...
2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
...(".Random.seed does not exist - in l'Ecuyer setting") .t <- snow::clusterSetupRNG(cl, seed=.Random.seed[2:7]) # => fails! } ## actual work foreach(i=seq_len(n)) %dopar% { runif(1) } } ## "standard" (base) way of specifying l'Ecuyer RNGkind("L'Ecuyer-CMRG") # => .Random.seed is of length 7 res <- doForeach(10, seed="L'Ecuyer-CMRG")
2003 Jan 28
5
random number generator?
Dear R-Aficionados: I realize that no random number generator is perfect, so what I report below may be a result of that simple fact. However, if I have made an error in my thinking I would greatly appreciate being corrected. I wish to illustrate the behavior of small samples (n=10) and so generate 100,000 of them. n.samples <- 1000000 sample.size = 10 p <- 0.0001 z.normal <- qnorm(p)