0% found this document useful (0 votes)
37 views

Simulation Models in Industrial Engineering: Random-Variate Generation

This document discusses techniques for generating random variates from specified probability distributions as inputs for simulation models. It describes three main techniques: 1. The inverse-transform technique, which generates a uniform random number and applies the inverse cumulative distribution function to obtain a random variate from the desired distribution. 2. The acceptance-rejection technique, which generates random variates that satisfy a given condition. 3. Using special properties of distributions like direct transformations for normal and lognormal distributions or convolution for generating other distributions. Examples are provided for each technique.

Uploaded by

Manh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Simulation Models in Industrial Engineering: Random-Variate Generation

This document discusses techniques for generating random variates from specified probability distributions as inputs for simulation models. It describes three main techniques: 1. The inverse-transform technique, which generates a uniform random number and applies the inverse cumulative distribution function to obtain a random variate from the desired distribution. 2. The acceptance-rejection technique, which generates random variates that satisfy a given condition. 3. Using special properties of distributions like direct transformations for normal and lognormal distributions or convolution for generating other distributions. Examples are provided for each technique.

Uploaded by

Manh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

SIMULATION MODELS IN

INDUSTRIAL ENGINEERING
Lesson 5
Random-Variate Generation

Tran Van Ly
Industrial Engineering & Management
International University
Email: tvly@hcmiu.edu.vn 1
Room: A2-504
Purpose

• Develop understanding of generating


samples from a specified distribution as
input to a simulation model.

• Illustrate some widely-used techniques for


generating random variates.
– Inverse-transform technique
– Acceptance-rejection technique
– Special properties
2
1. Inverse-transform Technique
1.1. Continuous distribution
• The concept: Suppose we
wish to generate a Random
Variate X that is continuous,
has distribution function cdf F:
0 < F(X) <1. Denote F-1 the
inverse of function F.
• The algorithm is F(x)
1
– For cdf function: R = F(X) R = F(x)
1. Generate R from uniform U(0,1) R

2. Return X:

X = F-1(R) X
3
Fig. 8.1 Inverse Transform Method
a. Exponential Distribution
• Exponential Distribution:
– Exponential

 xe  x , x  0 1  e  x , x  0
f  x    F  x    f (t )dt 
 0, x 0   0, x 0

– Algorithm
• Generate R ~U(0,1)
• Solve 1-e-λx = R
1
 X   ln(1  R )

• If we want to generate n values of


X:: X1, X2,…, Xn
- Generate uniform RN: R1, R2,…, Rn
- Return: 1
X i   ln(1  Ri ) ; i= 1, 2, …, n
 Figure: Inverse-transform technique for exp( = 1)

4
b. Uniform Distribution U(a,b)

– Uniform
 1
distribution 0; x  a
 x  a
 , a  xb F  x  
f  x   b  a , a  xb
 b  a
0, elsewhere  1, x b

– Algorithm
• Generate R~U(0,1)
• Return X = a + (b-a)R

5
c. Weibull Distributions

– Weibull distribution
   1 ( x / a ) 
 x e , x0
f ( x )   
 0 , otherwise
, β are scale and shape parameters
x
( ) 
F  x  1  e 
,x 0

– Algorithm
– Generate R~U(0,1)
– Return 1

X   [ ln(1  R)] 

6
1.2 Empirical Continuous Distributions
• Unable to find theoretical distribution → use empirical distribution
• Procedure:
– Collect data Xi; i= 1, 2, …, n
– Arrange data from smallest to largest
– Assign the probability 1/n to each interval [xi-1, xi]
– Compute the slope of ith line segment
x(i )  x(i 1) x(i )  x(i 1) i/n
ai  
i / n  (i  1) / n 1/ n R

– Generate R
– Return (i  1) 
(i-1)/n


X  Fˆ 1 ( R)  x(i 1)  ai  R   xi-1 x xi
 n 
X  x( i 1)
ai 
R  (i  1) / n 7
1.2 Empirical Continuous Distributions (cont.)
• Five observations of fire-crew response times (in mins.):
– 2.76 1.83 0.80 1.45 1.24
– Arranging x0 = 0; x1 = 0.8; x2 = 1.24; x3 = 1.45; x4 = 1.83; x5 = 2.76
– n = 5  probability for each interval = 1/n = 0.2

Cumalative
Interval Probability Probability,
i (Hours) 1/n i/n Slope, a i
1 0.0 ≤ x ≤ 0.80 0.2 0.20 4.00
2 0.8 ≤ x ≤ 1.24 0.2 0.40 2.20
3 1.24 ≤ x ≤ 1.45 0.2 0.60 1.05
4 1.45 ≤ x ≤ 1.83 0.2 0.80 1.90
5 1.83 ≤ x ≤ 2.76 0.2 1.00 4.65

8
1.2 Empirical Continuous Distributions (cont.)

Consider R 1 = 0.71:

(i-1)/n = 0.6 < R 1 < i/n = 0.8

X 1 = x (4-1) + a 4(R 1 – (4-1)/n)


= 1.45 + 1.90(0.71-0.60)
= 1.66

9
1. 3 Discrete Distribution

• Procedure P(x)
– With given pmf P(xi) = P(X=xi),
compute cdf
F ( x)  P( X  x)   P( xi )
xi  x

(Assume that X can take only the value x1<x2<… <xn) X1 X2 Xi-1 Xi
– Generate R~U(0,1) 1
– Determine the smallest integer I:
R≤ F(xI) R
Return X = xI
F2

X1 X2 Xi-1 Xi
10
1. 3 Discrete Distribution
1
p.m. f : p  x   ; x  1..k
k
c.d . f :
0 x 1
1
 k 1 x  2

 2 2 x3
 k
F  x  
...
 k 1
 k -1  x  k
 k Generate R~U(0,1)

1 kx If R satisfy:
i 1 i
F  i  1   R   F  i
k k
Then return X = i
11
Bernoulli and Binomial Distribution
Bernoulli Distribution
p.m. f : P X  0  p ; P X  1  1  p

• Generate R~U(0,1)
• If R ≤ p return X = 1, otherwise X = 0

Binomial Distribution B(n,p)

• Generate Y1, Y2, … , Yn as Bernoulli (p) random variates.

• Return X = Y1 + Y2 + … + Yn

12
2. Acceptance-Rejection technique
• Useful particularly when inverse cdf does not exist in closed form, a.k.a.
thinning
• Illustration: To generate random variates, X ~ U(1/4, 1)

Generate R
Procedures:
no
Step 1. Generate R ~ U[0,1]
Condition
Step 2a. If R >= ¼, accept X=R.
yes
Step 2b. If R < ¼, reject R, return
to Step 1 Output R’
• R does not have the desired distribution, but R conditioned (R’) on the
event {R  ¼} does.
• Efficiency: Depends heavily on the ability to minimize the number of
rejections.
13
Poisson Distribution

Based on the relationship between Poisson(λ) and Expo(1/λ)


•Set n = 0 and P =1
•Generate random number Ri+1 and replace P by

P x Ri+1 .
•If P < e-λ then accept X = i. Otherwise, reject current i, increase i by
1 and return previous step.

14
3. Special Properties
• Based on features of particular family of
probability distributions
• For example:
– Direct Transformation for normal and lognormal
distributions
– Convolution
– Beta distribution (from gamma distribution)

15
Direct Transformation [Special Properties]
• Approach for normal(0,1):
– Consider two standard normal random variables, Z1 and Z2, plotted as a
point in the plane:

In polar coordinates:
Z1 = B cos 
Z2 = B sin 

1–/ 2
B2 = Z21 + Z22 ~ chi-square distribution with 2 degrees of freedom =
B  (2 ln R)
Exp( = 2). Hence,
– The radius B and angle  are mutually independent.
Z1  ( 2 ln R )1/ 2 cos(2R2 )
Z 2  ( 2 ln R )1/ 2 sin( 2R2 )
16
Direct Transformation [Special Properties]
• Approach for normal(,):
– Generate Zi ~ N(0,1)
Xi =  +  Zi

• Approach for lognormal(,):


– Generate X ~ N(,)
Yi = eXi

17
Summary
• Principles of random-variate generate via
– Inverse-transform technique
– Acceptance-rejection technique
– Special properties
• Important for generating continuous and
discrete distributions

18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy