Week 1 Flashcards
1
Q
What is a Random Number Generator?
A
A deterministic algorithm that generates numbers U1, U2, U3, …, which appear to be random (independent) numbers from U(0, 1)
2
Q
What are the properties of a RNG?
A
- U1, U2, … should pass the hypothesis test of being i.i.d. U(0, 1)
- It should be sufficiently fast, e.g. 1 million numbers within a second
- You are able to recover the same sequence
- You are able to get the same numbers on different computers (with same programming language)
- A good RNG should have a long period
3
Q
What is the Linear congruential random number generator?
A
- modulus m in {2, 3, 4, …}
- multiplier a in {1, …, m -1}
- increment c in {0, 1, …, m - 1}
- initial value Y0 in {0, 1, …, m -1}
Then Yi+1= (aYi + c), and Ui = Yi / m
4
Q
What is the Lewis-Goodman-Miller generator?
A
It’s a Linear Congruential RNG with values:
a = 75 (= 16807)
c = 0
m = 231 - 1 (≈ 2.14 * 109)
5
Q
How to simulate random X using CDF FX(x)?
A
- Simulate U from U(0, 1)
- X = FX-1(U)
6
Q
What are the advantages and disadvantages of the inverse CDF?
A
Pro:
- Conceptually simple
Cons:
- Only available if FX-1 can be derived analytically
- Risc of numerical problems is large
- It is usually to slow
7
Q
How does the Acceptance-rejection method work?
A
- Simulate Y from proposal distribution gY(y)
- Simulate U distributed U(0, 1)
- Check if U ≤ fX(Y)/(M gY(Y)), where M = maxy fX(y)/gY(y)
If yes, X = Y, else reject Y