Displaying 20 results from an estimated 700 matches similar to: "R random number generator"
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 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
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
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
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
2003 Oct 16
2
.Random.seed
I am writing a function for the purposes of a simulation. Due to memory
problems, the function sometimes crashes. In order to get around this
problem, I would like to include to be able to save the "last" seed, so I
can pick up with the next run of the simulation after a "crash". I am
having trouble understanding what is going on with .Random.seed!
For each run of the
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)
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
2002 Aug 12
1
set.seed
I'm running into problems with set.seed--maybe I'm misunderstanding
something.
I'm running R 1.5.1 on Windows 2000.
I'm basically trying to capture the random seed so that I can reproduce a
simulation if it's necessary later. Using set.seed, I can certainly get
reproducible results, but not the results I get on the first pass. Here's
an example:
# Generate a random
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()
2000 Jan 19
1
random number generator
This question may not be specific to R, but I'm using R so here goes:
Since R is slow (as is Splus) I want to split a simulation and run it on
2 or 3 systems at once. The simulations involve generating a large number
of random values. How can I set .Random.seed so that the succession of
random values don't overlap across systems.
I see that when I invoke R and give command runif(1) a
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,
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
2013 Oct 10
1
Replacing the Random Number Generator in Stand Alone Library
Hi R-Developers,
I had a question about the random number generator used in the R StandAlone
Math Library. The stand-alone library depends on the unif_rand() function
for most simulated values, and this function is provided in the sunif.c file
in the relevant directory. At present, this program implements the
"Marsaglia-Multicarry" algorithm, which is described throughout the R
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
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
2012 Jan 27
2
The following code (using rgamma) hangs
Hi,
I'm seeing something that may be a bug in R's standalone math library,
which is packaged by Debian as r-mathlib. I reported it to the Debian BTS
as http://bugs.debian.org/657573
I'm using Debian squeeze, and the code was tested with r-mathlib 2.11.1-6
(default on stable) and 2.14.1-1 (from testing/unstable).
I summarize this report below. The following code with the R math