.lec.uniform.int generates random numbers from the discrete uniform
distribution over integers.
Usage
.lec.uniform (name, n = 1)
.lec.uniform.int (name, n = 1, a = 0, b = 10)
Arguments
name
name of the stream.
n
number of random numbers to be generated.
a,b
interval from which the integer random numbers should be generated.
Details
.lec.uniform and .lec.uniform.int, respectively, are wrapper functions for the C
functions RngStream_RandU01 and RngStream_RandInt, respectively (L'Ecuyer et al, 2002).
Note: Since the stream is here identified by name, there is no need for using the CurrentStream pair.
Value
A vector of n random numbers.
References
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.
See Also
.lec.CurrentStream
Examples
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)