Displaying 20 results from an estimated 11000 matches similar to: "Random Number Generators, .Random.seed and all that.."
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
[R] RNG Cycle and Duplication (PR#12540)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-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
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,
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
>
1999 Apr 29
0
Problems with setting .Random.seed (PR#179)
I have commited fixes for 0.64.1 for
(1) From: Mai Zhou <mai@ms.uky.edu>
> .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 ........
Here the length of the seed was being tested before the kind was
picked out, so the length of the previous type was used.
(2)
2018 Mar 05
1
Random Seed Location
On Sun, Mar 4, 2018 at 3:23 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 04/03/2018 5:54 PM, Henrik Bengtsson wrote:
>>
>> The following helps identify when .GlobalEnv$.Random.seed has changed:
>>
>> rng_tracker <- local({
>> last <- .GlobalEnv$.Random.seed
>> function(...) {
>> curr <- .GlobalEnv$.Random.seed
1999 Aug 20
0
seg.fault for some illegal .Random.seed (new since 0.64) (PR#253)
This is already in 0.64, but was okay in 0.63
In R version <= 0.63 :
> .Random.seed <- c(111,2,3)
> rnorm(1)
Warning: Wrong length .Random.seed; forgot initial RNGkind? set to Wichmann-Hill
[1] -0.4811529
> .Random.seed
[1] 0 6968 28861 26054
>
Now in 0.65 (pre-release) and both versions of 0.64 :
> .Random.seed <- c(111,2,3)
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()
2018 Mar 04
0
Random Seed Location
On 04/03/2018 5:54 PM, Henrik Bengtsson wrote:
> The following helps identify when .GlobalEnv$.Random.seed has changed:
>
> rng_tracker <- local({
> last <- .GlobalEnv$.Random.seed
> function(...) {
> curr <- .GlobalEnv$.Random.seed
> if (!identical(curr, last)) {
> warning(".Random.seed changed")
> last <<- curr
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
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
2018 Mar 04
0
Random Seed Location
Thank you, everybody, who replied! I appreciate your valuable advise! I will move the location of the set.seed() command to after all packages have been installed and loaded.
Best regards,
Gary
Sent from my iPad
> On Mar 4, 2018, at 12:18 PM, Paul Gilbert <pgilbert902 at gmail.com> wrote:
>
> On Mon, Feb 26, 2018 at 3:25 PM, Gary Black <gwblack001 at sbcglobal.net>
>
2003 Jun 13
0
Testing the R RNGs
I have applied L'Ecuyer's TESTU01 suite of RNG tests
to the RNGs in R. TESTU01 offers three increasingly
more stringent suites, called "Small Crush", "Crush" and
"Big Crush". If a particular RNG fails Small Crush, there
is no need to apply Big Crush.
Below I summarize the results:
Number of Tests Failed
Small Crush Crush Big Crush
2009 Feb 12
3
proposed simulate.glm method
I have found the "simulate" method (incorporated
in some packages) very handy. As far as I can tell the
only class for which simulate is actually implemented
in base R is lm ... this is actually a little dangerous
for a naive user who might be tempted to try
simulate(X) where X is a glm fit instead, because
it defaults to simulate.lm (since glm inherits from
the lm class), and the
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
1999 Jun 12
0
Random numbers
Hi,
I have a few questions about the RNG in R; apologies if these are dumb
questions:
1. It is my understanding that, among the three types of random number
generators available in R now, the best one is the Marsaglia Multicarry. Is
this correct?
2. How does the best RNG in R compare (in terms of quality) to the RNG in
SPlus? (based on Marsaglia's Super Duper)? Does the Super-Duper in
2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
Dear expeRts,
I struggle with the following problem using snow clusters for parallel computing: I would like to specify l'Ecuyer's random number generator. Base R creates a .Random.seed of length 7, the first value indicating the kind fo random number generator. I would thus like to use the components 2 to 7 as the seed for l'Ecuyer's random number generator.
By doing so, I
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
2018 Mar 04
2
Random Seed Location
The following helps identify when .GlobalEnv$.Random.seed has changed:
rng_tracker <- local({
last <- .GlobalEnv$.Random.seed
function(...) {
curr <- .GlobalEnv$.Random.seed
if (!identical(curr, last)) {
warning(".Random.seed changed")
last <<- curr
}
TRUE
}
})
addTaskCallback(rng_tracker, name = "RNG tracker")
EXAMPLE:
>