Displaying 20 results from an estimated 94 matches for "twister".
Did you mean:
twisted
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...
2016 Aug 30
4
A bug in the R Mersenne Twister (RNG) code?
...; 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 an R webs...
2016 Aug 31
1
A bug in the R Mersenne Twister (RNG) code?
...rom
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 used a de...
2016 Aug 30
0
A bug in the R Mersenne Twister (RNG) code?
...ject.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-randomnes...
2016 Sep 01
0
A bug in the R Mersenne Twister (RNG) code?
...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...
2016 Sep 01
2
A bug in the R Mersenne Twister (RNG) code?
...sion 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 information about...
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 provided by o...
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 mo...
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:
"Do no...
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
size n the...
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
...ead 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 been used i...
2008 Aug 17
1
Wichmann-Hill Random Number Generator and the Birthday Problem
...ng 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 Knuth-TAOCP-2002, M=2^30, since this modulus is used.
D = 46566.12 for N=10M samples.
For Marsaglia-Multicarry, Super-Duper and Mersene-Twister, M=2^32. D =
11641.53 for N = 10M samples.
My testing results (see below) agree with above analysis. But for
Wichmann-Hill, it wasn't. Wichmann-Hill's cycle is 6.9536e12 (refer to RNG
help by ?RNG and Whichmann's correction in 1984). Thus M <= 6.9536e12. D
>= 7.19052 when N=1...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...d 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",
> "86584272&quo...
2017 Nov 03
1
Extreme bunching of random values from runif with Mersenne-Twister seed
...s 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 CMD BATC...
2019 Feb 26
1
bias issue in sample() (PR 17494)
...ior 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,
>&g...
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"
T...
2017 Nov 03
0
Extreme bunching of random values from runif with Mersenne-Twister seed
...ing 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", "865774...
2013 Feb 18
2
Random number generator used in 'runif'
...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 Environment and...