Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A quick look at the help page of the random number generator of R shows that you can choose among 7 predefined generators (Wichmann-Hill, Marsaglia-Multicarry, Super-Duper, Mersenne-Twister, Knuth-TAOCP-2002, Knuth-TAOCP, L'Ecuyer-CMRG).


The default is Mersenne-Twister, which seems to be very good. So why would you ever need to use another one?

share|improve this question
up vote 4 down vote accepted

One case where this RNG cornucopia is handy is when you're rewriting or comparing software that rely on different RNGs. One example might be porting R code to C++. You want to pin down why you're getting different results and it helps to hold as many things constant as possible.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.