You are on page 1of 10

MODUL PERKULIAHAN

Simulasi Sistem

Variate Generation Using The


Inverse Transform Method

Tatap
Fakultas Program Studi Kode MK Disusun Oleh
Muka
Fakultas Teknik Teknik Industri 05610001 Dr. Nova Indah Saragih, S.T., M.T.

06
Abstrak Kompetensi
Modul ini membahas Mahasiswa mampu menerapkan
pembangkitan variat pembangkitan variat
menggunakan metode Inverse menggunakan metode Inverse
Transform. Transform.

1
Variate Generation Using The Inverse Transform Method

The single-variate generation problem seeks to transform an iid uniform sequence


of variates {Un} into an iid sequence of variates {Xn}, such that Xn ~ G.
Furthermore, it is desirable that the generation method be general, namely,
applicable to any requisite distribution, G.

The most general and widely used method is the Inverse Transform method. It
relies on the following properties of the cdf FX(x) of a variate X, and their relation
to a uniform variate U ~ Unif (0, 1).

Evaluating the distribution function FX(x) at the underlying variate X results in a


variate U, given by

U = FX(X) (1)

whose cdf is uniform between 0 and 1.

Conversely, evaluating an inverse distribution function F-1X(u) at a uniform


variate U ~ Unif (0, 1) results in a variate

X = F-1X(u) (2)

with cdf FX(x). Note that since every cdf, FX(x), is nondecreasing (from 0 to 1), it
follows that its inverse, F-1X(u), is always well defined.

For a given cdf FX(x), Eq. 2 implicitly describes the generation of the underlying
variate, X, via the Inverse Transform method as a two-step algorithm:

1. Use your favorite RNG to generate a realization u from a variate U ~ Unif


(0, 1).
2. Compute x = F-1X(u) as a realization of X.

Figure 1 illustrates graphically an application of the Inverse Transform method.

2
Figure 1. The Inverse Transform method

1. Generation Of Exponential Variates

Setting U = F(x) and solving for x yields:

U = 1 − e− x / 

e− x /  = 1 − U

( )
ln e − x /  = ln(1 − U )

− x  = ln(1 − U )

x = −  ln(1 − U )

The random variate x is exponentially distributed with mean β.

For example, given β = 2, then

U1 = 0.27 → x1 = −2 ln(1 − 0.27 ) = 0.63

U 2 = 0.89 → x2 = −2 ln(1 − 0.89) = 4.41

3
Figure 2. The Inverse Transform of Exponential Variates for β = 2

2. Using Ms. Excel to generate exponential variates

Consider an ATM system with these data:

▪ Customer arrives to use an ATM at a mean interarrival time of 3.0 minutes


exponentially distributed.

▪ Customer spend an average of 2.4 minutes exponentially distributed to


complete their transactions.

The steps to generate exponential variates for interarrival time and service
time of the ATM system using Ms. Excel are:

1. Generate random number using congruential generators from previous


chapter with a = 21, c = 3, m = 16, and x0 = 0.

i x U

0 0 0
1 3 0,188
2 2 0,125
3 13 0,813
4 4 0,250
5 7 0,438
6 6 0,375
7 1 0,063

4
8 8 0,500
9 11 0,688
10 10 0,625
11 5 0,313
12 12 0,750
13 15 0,938
14 14 0,875
15 9 0,563
16 0 0,000
17 3 0,188
18 2 0,125
19 13 0,813
20 4 0,250
21 7 0,438
22 6 0,375
23 1 0,063
24 8 0,500
25 11 0,688
26 10 0,625
27 5 0,313
28 12 0,750
29 15 0,938
30 14 0,875
31 9 0,563
32 0 0,000
33 3 0,188
34 2 0,125
35 13 0,813
36 4 0,250
37 7 0,438
38 6 0,375

5
39 1 0,063
40 8 0,500
41 11 0,688
42 10 0,625
43 5 0,313
44 12 0,750
45 15 0,938
46 14 0,875
47 9 0,563
48 0 0,000
49 3 0,188
50 2 0,125

2. Create a column for variate interarrival time beside U column with β = 3.0
minutes exponentially distributed using x = −  ln(1 − U )
The examples in Ms. Excel are:
▪ For i = 1, column random variate interarrival time is -3*LN(1-0,188)
▪ For i = 2, column random variate interarrival time is -3*LN(1-0,125)
▪ For i = 3, column random variate interarrival time is -3*LN(1-0,813)

i x U Variate interarrival time

0 0 0
1 3 0,188 0,62
2 2 0,125 0,40
3 13 0,813 5,02
4 4 0,250 0,86
5 7 0,438 1,73
6 6 0,375 1,41
7 1 0,063 0,19
8 8 0,500 2,08
9 11 0,688 3,49

6
10 10 0,625 2,94
11 5 0,313 1,12
12 12 0,750 4,16
13 15 0,938 8,32
14 14 0,875 6,24
15 9 0,563 2,48
16 0 0,000 -
17 3 0,188 0,62
18 2 0,125 0,40
19 13 0,813 5,02
20 4 0,250 0,86
21 7 0,438 1,73
22 6 0,375 1,41
23 1 0,063 0,19
24 8 0,500 2,08
25 11 0,688 3,49
26 10 0,625 2,94
27 5 0,313 1,12
28 12 0,750 4,16
29 15 0,938 8,32
30 14 0,875 6,24
31 9 0,563 2,48
32 0 0,000 -
33 3 0,188 0,62
34 2 0,125 0,40
35 13 0,813 5,02
36 4 0,250 0,86
37 7 0,438 1,73
38 6 0,375 1,41
39 1 0,063 0,19
40 8 0,500 2,08

7
41 11 0,688 3,49
42 10 0,625 2,94
43 5 0,313 1,12
44 12 0,750 4,16
45 15 0,938 8,32
46 14 0,875 6,24
47 9 0,563 2,48
48 0 0,000 -
49 3 0,188 0,62
50 2 0,125 0,40

3. Create a column for random variate service time beside variate interarrival
time column with β = 2.4 minutes exponentially distributed using
x = −  ln(1 − U )
The examples in Ms. Excel are:
▪ For i = 1, column random variate interarrival time is -2.4*LN(1-0,188)
▪ For i = 2, column random variate interarrival time is -2.4*LN(1-0,125)
▪ For i = 3, column random variate interarrival time is -2.4*LN(1-0,813)

i x U Variate interarrival time Variate service time

0 0 0
1 3 0,188 0,62 0,50
2 2 0,125 0,40 0,32
3 13 0,813 5,02 4,02
4 4 0,250 0,86 0,69
5 7 0,438 1,73 1,38
6 6 0,375 1,41 1,13
7 1 0,063 0,19 0,15
8 8 0,500 2,08 1,66
9 11 0,688 3,49 2,79
10 10 0,625 2,94 2,35

8
11 5 0,313 1,12 0,90
12 12 0,750 4,16 3,33
13 15 0,938 8,32 6,65
14 14 0,875 6,24 4,99
15 9 0,563 2,48 1,98
16 0 0,000 - 0,00
17 3 0,188 0,62 0,50
18 2 0,125 0,40 0,32
19 13 0,813 5,02 4,02
20 4 0,250 0,86 0,69
21 7 0,438 1,73 1,38
22 6 0,375 1,41 1,13
23 1 0,063 0,19 0,15
24 8 0,500 2,08 1,66
25 11 0,688 3,49 2,79
26 10 0,625 2,94 2,35
27 5 0,313 1,12 0,90
28 12 0,750 4,16 3,33
29 15 0,938 8,32 6,65
30 14 0,875 6,24 4,99
31 9 0,563 2,48 1,98
32 0 0,000 - 0,00
33 3 0,188 0,62 0,50
34 2 0,125 0,40 0,32
35 13 0,813 5,02 4,02
36 4 0,250 0,86 0,69
37 7 0,438 1,73 1,38
38 6 0,375 1,41 1,13
39 1 0,063 0,19 0,15
40 8 0,500 2,08 1,66
41 11 0,688 3,49 2,79

9
42 10 0,625 2,94 2,35
43 5 0,313 1,12 0,90
44 12 0,750 4,16 3,33
45 15 0,938 8,32 6,65
46 14 0,875 6,24 4,99
47 9 0,563 2,48 1,98
48 0 0,000 - 0,00
49 3 0,188 0,62 0,50
50 2 0,125 0,40 0,32

Sumber:

1. Altiok, T. and Melamed, B. (2007): Simulation Modeling and Analysis


with Arena, Elsevier Inc.
2. Law, A.M. and Kelton, W.D. (1991): Simulation Modeling And Analysis,
McGraw-Hill.

10

You might also like