[R] Initialising Mersenne-Twister with one integer

From: Gad Abraham <g.abraham_at_ms.unimelb.edu.au>
Date: Mon 25 Sep 2006 - 08:32:58 GMT


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 correct rng.kind for the Mersenne-Twister?

I'm using R version 2.2.1, 2005-12-20 on Ubuntu Dapper Linux 686.


Gad Abraham
Department of Mathematics and Statistics
University of Melbourne
Parkville 3010, Victoria, Australia
email: g.abraham@ms.unimelb.edu.au
web: http://www.ms.unimelb.edu.au/~gabraham

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon Sep 25 18:37:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 25 Sep 2006 - 09:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.