search for: mersenne

Displaying 20 results from an estimated 97 matches for "mersenne".

Did you mean: merseine
2016 Aug 31
1
A bug in the R Mersenne Twister (RNG) code?
...Quoting from https://www.gnu.org/software/gsl/manual/html_node/Random-number-generator-algorithms.html Generator: gsl_rng_mt19937 The MT19937 generator of Makoto Matsumoto and Takuji Nishimura is a variant of the twisted generalized feedback shift-register algorithm, and is known as the ?Mersenne Twister? generator. It has a Mersenne prime period of 2^19937 - 1 (about 10^6000) and is equi-distributed in 623 dimensions. It has passed the DIEHARD statistical tests. It uses 624 words of state per generator and is comparable in speed to the other generators. The original generator u...
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 ha...
2016 Aug 30
4
A bug in the R Mersenne Twister (RNG) code?
...eport" 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 not possible to generate the correct stream of pseudorandom numbers using the MT default random number generator in R, and am not the first person to notice this. Here is a posted 2013 entry (www.r-bloggers.com/reproducibility-and-randomness/) on...
2016 Aug 30
0
A bug in the R Mersenne Twister (RNG) code?
...-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 not possible to generate > the correct stream of pseudorandom numbers using the MT default random > number generator in R, and am not the first person to notice this. Here > is a posted 2013 entry > (www.r-bloggers.com/reproducibility-...
2016 Sep 01
0
A bug in the R Mersenne Twister (RNG) code?
...ems, and then it would be >> worth considering a change. But changing the default RNG definitely >> introduces problems in reproducibility, >> > > Well "problems in reproducibility" is a bit vague. Results would always be > reproducible by specifying kind="Mersenne-Twister" or kind="Buggy > Kinderman-Ramage" for older results, so there is no problem reproducing > results. The only problem is that users expecting to reproduce results > twenty years later will need to know what random generator they used. (BTW, > they may also need to...
2016 Sep 01
2
A bug in the R Mersenne Twister (RNG) code?
...newer version fixes some problems, and then it would be > worth considering a change. But changing the default RNG definitely > introduces problems in reproducibility, Well "problems in reproducibility" is a bit vague. Results would always be reproducible by specifying kind="Mersenne-Twister" or kind="Buggy Kinderman-Ramage" for older results, so there is no problem reproducing results. The only problem is that users expecting to reproduce results twenty years later will need to know what random generator they used. (BTW, they may also need to record informati...
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. Wagner v1.0 15 May 2003 rjwagner at writeme.com the random seed for the Mersenne-Twister is provi...
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 l...
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 documented in ?Random: &qu...
2017 Nov 04
0
Extreme bunching of random values from runif with Mersenne-Twister seed
In the code below, you seem to be essentially using the random number generator to implement a hash function. This isn't a good idea. My impression is that pseudo-random number generation methods are generally evaluated by whether the sequence produced from any seed "appears" to be random. Informally, there may be some effort to make long sequences started with seeds 1, 2, 3, etc.
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 that for a sample si...
2017 Nov 05
0
Extreme bunching of random values from runif with Mersenne-Twister seed
> On 5 Nov 2017, at 15:17 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 04/11/2017 10:20 PM, Daniel Nordlund wrote: >> Tirthankar, >> "random number generators" do not produce random numbers. Any given >> generator produces a fixed sequence of numbers that appear to meet >> various tests of randomness. By picking a seed you enter
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...u *had* read it ? > 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 > `"Mersenne-Twister"`). again this is not what the help page says; rather | The use of ?kind = NULL? or ?normal.kind = NULL? in ?RNGkind? or | ?set.seed? selects the currently-used generator (including that | used in the previous session if the workspace has been restored): | if no generator has bee...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...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 > `"Mersenne-Twister"`). > > We set the seed using (8 digit) unique IDs generated by an upstream system, > before calling `runif`: > > seeds = c( > "86548915", "86551615", "86566163", "86577411", "86584144", > "8658...
2017 Nov 03
1
Extreme bunching of random values from runif with Mersenne-Twister seed
...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 & zero down on the core issue, since I continue to believe that this is an issue with either R's implementation or a bad interaction of the seeds supplied with the Mersenne-Twister algorithm itself. The latter would require a deeper understanding of the algorithm than I have at the moment. If we can rule out the former through this thread, then I will pursue the latter solution path. Responses inline below, but summarizing: 1. All examples now are run using "R...
2019 Feb 26
1
bias issue in sample() (PR 17494)
...ing 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...
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] "Wichmann-Hill" "Inversion&...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...e 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 >>> `"Mersenne-Twister"`). >>> >>> We set the seed using (8 digit) unique IDs generated by an upstream >>> system, >>> before calling `runif`: >>> >>> seeds = c( >>> "86548915", "86551615", "86566163", &quo...
2013 Feb 18
2
Random number generator used in 'runif'
...thm 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 would be really grateful if somebody with experience in random number generators could confirm that or tell me what is the method actually used. Thanks in advance, Mauricio Zambrano-Bigiarini -- ===================================== Water Resources Unit Institute for Environ...
2013 Feb 21
1
limitations to random number generator in 64-bits machines
Dear List, Recently I got the comment that the implementation of the random number generator used by default in R (Mersenne-Twister) could not be "safe" for 64-bits machines, so I decided to put the question here because I do not have expertise in that topic, and because this question could be "too technical for R-help's audience". I apologise if this is not the case. The period 2^19937 - 1 m...