EVOLUTION-MANAGER
Edit File: uniform.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Generate random numbers</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for uniform {rlecuyer}"><tr><td>uniform {rlecuyer}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Generate random numbers</h2> <h3>Description</h3> <p><code>.lec.uniform</code> generates <i>U(0,1)</i> random numbers. </p> <p><code>.lec.uniform.int</code> generates random numbers from the discrete uniform distribution over integers. </p> <h3>Usage</h3> <pre> .lec.uniform (name, n = 1) .lec.uniform.int (name, n = 1, a = 0, b = 10) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>name of the stream.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>number of random numbers to be generated.</p> </td></tr> <tr valign="top"><td><code>a,b</code></td> <td> <p>interval from which the integer random numbers should be generated.</p> </td></tr> </table> <h3>Details</h3> <p><code>.lec.uniform</code> and <code>.lec.uniform.int</code>, respectively, are wrapper functions for the C functions <code>RngStream_RandU01</code> and <code>RngStream_RandInt</code>, respectively (L'Ecuyer et al, 2002). </p> <p>Note: Since the stream is here identified by <code>name</code>, there is no need for using the <code><a href="CurrentStream.html">CurrentStream</a></code> pair. </p> <h3>Value</h3> <p>A vector of <i>n</i> random numbers.</p> <h3>References</h3> <p>P. L'Ecuyer, R. Simard, E.J.Chen and W.D.Kelton: An Object-Oriented Random-Number Package With Many Long Streams and Substreams; Operations Research, vol. 50, nr. 6, 2002.</p> <h3>See Also</h3> <p><code><a href=".lec.CurrentStream.html">.lec.CurrentStream</a></code></p> <h3>Examples</h3> <pre> nstreams <- 10 # number of streams seed<-rep(1,6) .lec.SetPackageSeed(seed) names <- paste("mystream",1:nstreams,sep="") .lec.CreateStream(names) for (i in 1:nstreams) # generate 10 RNs from each stream print(.lec.uniform(names[i],10)) .lec.DeleteStream(names) </pre> <hr /><div style="text-align: center;">[Package <em>rlecuyer</em> version 0.3-4 <a href="00Index.html">Index</a>]</div> </body></html>