16.04.2014 Views

Embedding R in Windows applications, and executing R remotely

Embedding R in Windows applications, and executing R remotely

Embedding R in Windows applications, and executing R remotely

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RNGstreams — An R package for multiple<br />

<strong>in</strong>dependent streams of uniform r<strong>and</strong>om numbers<br />

Günter Tirler, Pierre L’Ecuyer <strong>and</strong> Josef Leydold<br />

The core R implementation of uniform r<strong>and</strong>om number generation uses a<br />

global procedure that can be used for r<strong>and</strong>om generation purposes. It can be<br />

changed by means of the RNGk<strong>in</strong>d function. However, this approach is not always<br />

convenient for simulation. In this contribution we propose a new approach<br />

that uses classes where <strong>in</strong>dependent <strong>in</strong>stances of uniform r<strong>and</strong>om number generators<br />

can be created. R<strong>and</strong>om streams can then be generated by methods of<br />

this class. Moreover these streams can be <strong>in</strong>dependently reset to their start<strong>in</strong>g<br />

values. It is also easy to generate common or antithetic r<strong>and</strong>om variates as<br />

they required for variance reduction techniques. Another important feature is<br />

its ability to use this approach for parallel comput<strong>in</strong>g, as this usually requires<br />

<strong>in</strong>dependent streams of uniform r<strong>and</strong>om numbers on each node. In a first implementation<br />

these <strong>in</strong>stances can be used together to replace the build-<strong>in</strong> RNGs.<br />

But with such a concept it would be possible to run r<strong>and</strong>om rout<strong>in</strong>es with different<br />

RNGs when the <strong>in</strong>stance of the r<strong>and</strong>om stream is given as an argument. Yet<br />

we have implemented an <strong>in</strong>terface to two sources of uniform r<strong>and</strong>om number generators:<br />

the rngstreams library by P. L’Ecuyer (http://www.iro.umontreal.ca/<br />

lecuyer) <strong>and</strong> O. Lendl’s implementation of various types r<strong>and</strong>om number generators<br />

(LCG, ICG, EICG), see http://statistik.wu-wien.ac.at/prng/.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!