Random Variate Generation
[Pages:47]Random Variate Generation
CS1538: Introduction to Simulations
Random Variate Generation
Once we have obtained / created and verified a quality random number generator for U[0,1), we can use that to obtain random values in other distributions
Ex: Exponential, Normal, etc.
There are several techniques for generating random variates
Some are more efficient than others Some are easier to implement than others
2
Methods for Generating Random Variates
Method 1: Inverse Transform Method 2:Accept/Reject Method 3: Special Properties
Method #1: Inverse Transform Technique
Applicable to distributions with a closed mathematical formula
There is some function F-1 that maps values from U[0,1) into the desired distribution
4
Inverse Transform
Suppose we want to sample from some continuous distribution with CDF F(x) = Pr(X x).
We want to know the inverse of F(x), F-1(x).
That is, F(F-1(x)) = F-1(F(x)) = x
Example: x2 and sqrt(x) are inverses of each other
Because we know that 0 F(x) 1, the outcome of F(x) can be represented by a draw from U[0,1), call that R.
If we know F-1(x), we can get a sample from the desired distribution by calculating F-1(R).
Inverse Transform
General strategy for finding F-1(x):
Begin with: y = F(x) Go through some algebra to write the equation in terms of
x = G(y) G(y) is basically the F-1(x) we're looking for.
Example: Exponential Distribution
CDF for Exponential Distribution:
F
(
x)
0 , 1
x elx ,
0
x
0
We want to find F-1(x) such that F-1(F(x)) = x
F-1(x) = (-1/l) ln(1-x)
7
Example: Exponential Distribution
CDF for Exponential Distribution:
F
(
x)
0 , 1
x elx ,
0
x
0
We want to find F-1(x) such that F-1(F(x)) = x
F-1(x) = (-1/l) ln(1-x)
Implement in code:
def rand_expon(lambda): R = rand() return -ln(1-R)/lambda
9
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- 2 generator basics ieee
- differentiable generator nets
- random variables university of texas at austin
- simple random sampling and systematic sampling
- random variate generation
- sketch idea generator sketchpad comedy
- procedures nasig home
- lab 2 circuit simulation
- random variables
- unit 1 exploring and understanding data 25 days
Related searches
- question generation for question answering
- next generation accuplacer score chart
- apa 6th generation citation generator
- accuplacer next generation reading scores
- dodge truck generation years
- air force next generation fighter
- next generation air dominance program
- biblical generation length
- wave generation system
- sound wave generation power wiki
- ocean wave generation of electricity
- the young generation of today