Displaying 20 results from an estimated 2000 matches similar to: "Speed of runif() on different Operating Systems"
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
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
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()
2013 Feb 18
2
Random number generator used in 'runif'
Dear list,
For the implementation of a particular optimization algorithm it is
very important the random number generator.
I would like to know if somebody could tell me what is the random
number generator used by default in the 'runif' function.
>From the help page of 'runif' and '.Random.seed' I guess that the
default algorithm is 'Mersenne-Twister', but I
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
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
2016 Aug 31
1
A bug in the R Mersenne Twister (RNG) code?
On 30 August 2016 at 18:29, Duncan Murdoch wrote:
| I don't see evidence of a bug. There have been several versions of the
| MT; we may be using a different version than you are. Ours is the
| 1999/10/28 version; the web page you cite uses one from 2002.
|
| Perhaps the newer version fixes some problems, and then it would be
| worth considering a change. But changing the default RNG
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
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
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
2007 Oct 17
0
predictable bit patterns in runif(n) shortly after set.seed
Mersenne Twister generator is known to be sensitive to the
algorithm used to generate its initial state. The initialization
used in R generates the initial state in a way, which leaves
linear dependencies mod 2 among the bits in the initial state.
Since Mersenne Twister performs only operations, which are
linear mod 2, these dependencies propagate to the output sequence.
An easy to see
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
2009 May 12
4
different results on linux and windows
Dear R experts,
we are preparing an R-package to compute the Oja Median which contains
some C++ code in which random numbers are needed. To generate the random
numbers we use the following Mersenne-Twister implementation:
// MersenneTwister.h
// Mersenne Twister random number generator -- a C++ class MTRand
// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
// Richard J.
2005 Dec 15
1
precision of rnorm
How many distinct values can rnorm return?
I assume that rnorm manipulates runif in some way, runif uses the Mersenne
Twister, which has a period of 2^19937 - 1. Given that runif returns a 64
bit precision floating point number in [0,1], the actual period of the
Mersenne Twister in a finite precision world must be significantly less.
One of the arguments for Monte Carlo over the bootstrap is
2016 Aug 30
4
A bug in the R Mersenne Twister (RNG) code?
Whomever,
I recently sent the "bug report" below toR-core at r-project.org and have
just been asked to instead submit it to you.
Although I am basically not an R user, I have installed version 3.3.1
and am also the author of a statistics program written in Visual Basic
that contains a component which correctly implements the Mersenne
Twister (MT) algorithm. I believe that it is
2006 Sep 25
1
Initialising Mersenne-Twister with one integer
Hi,
It seems to me that the Mersenne-Twister PRNG can be initialised using
one integer instead of 624 integers, since inside RNG.c code there's a
function defined as MT_sgenrand(Int32).
How do I actually set this seed within R?
I've tried:
> .Random.seed <- c(3, 1)
> runif(1)
Error in runif(1) : .Random.seed has wrong length
In addition, is '3' actually the
2016 Sep 01
2
A bug in the R Mersenne Twister (RNG) code?
On 08/30/2016 06:29 PM, Duncan Murdoch wrote:
> I don't see evidence of a bug. There have been several versions of the
> MT; we may be using a different version than you are. Ours is the
> 1999/10/28 version; the web page you cite uses one from 2002.
>
> Perhaps the newer version fixes some problems, and then it would be
> worth considering a change. But changing the
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
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)
2000 May 25
4
Needed: Understading runif() output :-)
Dear all,
I have been trying to understand what runif() is telling me.
I am generating lots of numbers (billions and billions (wow, I''ve dreamed
about saying that for many years... :-) ), for a distribution that has the
following quantile function:
1 / (2 * sqrt(1 - p))
(that is, the distribution has a lower cutoff)
As you can imagine, this has rather heavy upper tail. I was