Chapitre 5-Simulation
Chapitre 5-Simulation
Chapter 5
Randomness in Simulation
Plan
Objective
Random Numbers
Random Number Generators (LCG, CMRG)
Variate Generation
Variance Reduction
Objective
Use the LCG with : a= 3, c=3, m=5 and the seed X0=3 to generate
random variable Ui.
The LCG
The selection of the values for a, c, m drastically affects the cycle length.
Xi = (5 Xi–1 + 6) mod 32
Xi = (5 Xi–1 + 5) mod 32
Xi = (2 Xi–1 + 4) mod 63
See LCG.xls
Issues with LCGs
Theorem:
In order to have a sequence of maximal length i.e. length
equal to m, 3 conditions must be verified:
i) “c” and “m” are relatively prime, i.e., the only positive
integer that exactly divides both m and c is 1.
ii) (a-1) is a multiple of each prime number which divides
“m” (including m if m is prime).
iii) if “m” is a multiple of 4 then (a-1) is also a multiple of 4
Issues with LCG
Cycle length: < m
Typically, m = 2.1 billion (m = 231 )or more
Other parameters chosen so that cycle length = m
Statistical properties
Uniformity, independence
There are many tests
Empirical tests
K-S tests
Issues with LCG
Suppose 5 generated numbers are 0.44, 0.81, 0.14, 0.05, and 0.93. It is desired to
perform a test for uniformity using Kolmogorov-Smirnov test with a level of
significance α = 0.05.
Issues with LCGs
“Regularity”
of LCGs (and other kinds of RNGs); for
example earlier LCG :
Solution:
Other kinds of RNGs — longer memory in
recursion, combination of several LCGs
Combined Multiple Recursive Generator(CMRG)
Uses some of same ideas as LCG
Modulo division, recursive on earlier values
But is not an LCG
Combines two separate generators
Synchronized
CRN