Random number generator used in 'runif'

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Random number generator used in 'runif'

Mauricio Zambrano-Bigiarini-2
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 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 Sustainability
Joint Research Centre, European Commission
webinfo    : http://floods.jrc.ec.europa.eu/
=====================================
DISCLAIMER:\ "The views expressed are purely those of th...{{dropped:12}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Random number generator used in 'runif'

S Ellison-2
On the same help page, it says "'RNGkind' is a more friendly interface to query or set the kind of
     RNG in use."

Try
RNGkind()

to see the currently selected RNG. The same function with kind= specified will also change to another

S Ellison

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Mauricio
> Zambrano-Bigiarini
> Sent: 18 February 2013 09:33
> To: [hidden email]
> Subject: [R] 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 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 Sustainability Joint Research
> Centre, European Commission
> webinfo    : http://floods.jrc.ec.europa.eu/
> =====================================
> DISCLAIMER:\ "The views expressed are purely those of
> th...{{dropped:12}}
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Random number generator used in 'runif'

Daniel Nordlund-4
In reply to this post by Mauricio Zambrano-Bigiarini-2
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Mauricio Zambrano-Bigiarini
> Sent: Monday, February 18, 2013 1:33 AM
> To: [hidden email]
> Subject: [R] 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 would be really
> grateful if somebody with experience in random number generators could
> confirm that or tell me what is the method actually used.

No guessing necessary, as the R-help is quite explicit


Details

The currently available RNG kinds are given below. kind is partially matched to this list. The default is "Mersenne-Twister".



Hope this is helpful,

Dan

Daniel Nordlund
Bothell, WA USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Random number generator used in 'runif'

Mauricio Zambrano-Bigiarini-2
2013/2/18 Daniel Nordlund <[hidden email]>:

>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> On Behalf Of Mauricio Zambrano-Bigiarini
>> Sent: Monday, February 18, 2013 1:33 AM
>> To: [hidden email]
>> Subject: [R] 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 would be really
>> grateful if somebody with experience in random number generators could
>> confirm that or tell me what is the method actually used.
>
> No guessing necessary, as the R-help is quite explicit

Thank you very much for all the replies.

I was asking because I did not see any 'rng.kind' argument within the
'runif' function, and I wanted to be sure that what is mentioned in
the help page of '.Random.seed' is valid for 'runif' and all the
related functions.

Thanks again,

Mauricio


--
======================================
Linux user #454569 -- Ubuntu user #17469
======================================
"Where ambition ends happiness begins"
(Source Unknown)
======================================
http://www.r-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.