Random Variate Generation - University of Pittsburgh
[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
- random numbers
- python modules cbse class xi class xii
- random numbers random walk umass
- chapter 5 generating random numbers from distributions ksu
- chapter 7 random number generation western michigan university
- chapter 3 pseudo random numbers generators university of arizona
- random number generation rice university
- random number generators columbia university
- randomseq python command‒line random sequence generator
- random number generation washington university in st louis
Related searches
- university of minnesota college of education
- university of minnesota school of social work
- wharton school of the university of pennsylvania
- cost of university of scranton
- city of pittsburgh jobs
- city of pittsburgh jobs website
- city of pittsburgh career opportunities
- city of pittsburgh employment
- city of pittsburgh job openings
- city of pittsburgh job postings
- university of pittsburgh the joseph m katz graduate school of business economi
- city of pittsburgh employment application