Académique Documents
Professionnel Documents
Culture Documents
> o |
=
|
o | |
otherwise , 0
0 x , e x } / {
) x ( f
) / x ( 1
Random Variate Generation 12
Random Variate Generation
(cont.)
Now, to generate Weibull variates:
Step 1. cdf: F(x) = 1 - , x > 0
Step 2. 1 - = R
Step 3. X = o [-ln(1-R)]
1/|
or X = o [-ln(R)]
1/|
Note: The density function f(x) of a continuous
random variable may be interpreted as the relative
chance of observing variates on different parts of the
range
|
o ) / x (
e
|
o ) / x (
e
Random Variate Generation 13
Random Variate Generation
(cont.)
On regions of the x axis above which f(x) is high, we
expect to observe a lot of variates, and where f(x)
is low we should find only a few.
We can view f(x) as the slope function of F at x.
Random Variate Generation 14
Random Variate Generation
(cont.)
Intervals for U and X, inverse
transform for Weibull(1.5, 6) distribution
Example: Weibull Distribution
Random Variate Generation 15
Random Variate Generation
(cont.)
Sample of 50 Us and Xs, inverse
transform for Weibull(1.5, 6) Distribution
Density for Weibull
(1.5, 6) distribution
Random Variate Generation 16
Random Variate Generation
(cont.)
Uniform Distribution
Consider a random variable X that is uniformly
distributed on the interval [a, b]
1 / (b-a) , a s x s b
pdf: f(x) =
0 , otherwise
Random Variate Generation 17
Random Variate Generation
(cont.)
To generate random variates:
Step 1. 0 , x < a
F(x) = (x - a) / (b - a) , a s x s b
1 , x > b
Step 2. F(x) = (x - a) / (b - a) = R
Step 3. X = a + (b - a) R
Random Variate Generation 18
Random Variate Generation
(cont.)
If the modeler has been unable to find a theoretical
distribution that provides a good model for the
input data, it may be necessary to use the
empirical distribution of the data.
Example:
Suppose that 100 broken widget repair times have
been collected. The data are summarized in the
next slide in terms of the number of observations
in various intervals. For example, there were 31
observations between 0 and 0.5 hour, 10 between
Random Variate Generation 19
Random Variate Generation
(cont.)
0.5 and 1 hour, and so on.
Interval Relative Cumulative
(Hours) Frequency Frequency Frequency
0 s x s 0.5 31 0.31 0.31
0.5 s x s 1.0 10 0.10 0.41
1.0 s x s 1.5 25 0.25 0.66
1.5 s x s 2.0 34 0.34 1.00
The true underlying distribution, F(x), of repair
times (the curve in next slide) can be estimated by
the empirical cdf, F(x)(the piecewise linear curve)
Random Variate Generation 20
Random Variate Generation
(cont.)
Empirical and theoretical distribution functions,
for repair time data (X > 0)
Random Variate Generation 21
Random Variate Generation
(cont.)
The inverse transform technique applies directly to
generating repair time variates, X. Recalling the
graphical interpretation of the technique, first
generate a random number R
1
, say R
1
= 0.83, and
read X
1
off the graph of next slide. Symbolically,
this is written as X
1
= F
-1
(R
1
)
but algebraically, since R
1
is between 0.66 and
1.00, X
1
is computed by a linear interpolation
between 1.5 and 2.0; that is
Random Variate Generation 22
Random Variate Generation
(cont.)
Generating variates from the empirical distribution
function for repair time data (X > 0.25)
Random Variate Generation 23
Random Variate Generation
(cont.)
X
1
= 1.5 + {(R
1
- 0.66) / (1 - 0.66)} (2.0 - 1.5)
= 1.75
When R
1
= 0.83, note that (R
1
- 0.66) / (1 - 0.66) = 0.5,
so that X
1
will be one-half of the distance between 1.5
and 2.0 since R
1
is one-half of the way between 0.66
and 1.00
Random Variate Generation 24
Random Variate Generation
(cont.)
The slopes of the four line segments are given in the
next slide and in the following table, which can be
used to generate variates, X, as follows.
i Input, r
i
Outut, x
i
Slope, a
i
1 0
0.25
0.81
2 0.31
0.5
5.0
3 0.41
1.0
2.0
4 0.66
1.5
1.47
5 1.00
2.0
---
Intervals and Slopes for generating repair times, X
Random Variate Generation 25
Random Variate Generation
(cont.)
Inverse CDF of repair times
Random Variate Generation 26
Random Variate Generation
(cont.)
Step 1. Generate R
Step 2. Find the interval i in which R lies; that is,
find i so that r
i
s R s r
i+1
Step 3. Compute X by
X = x
i
+ a
i
(R - r
i
)
Random Variate Generation 27
Direct Transformation for the
Normal Distribution
Polar representation of a pair of standard normal variables
Standard Normal Distribution
u(x) = }
x
-
{1/ (\2t)} dt, - < x <
2 / ) I (
2
e