USA: +1-585-535-1023

UK: +44-208-133-5697

AUS: +61-280-07-5697

Simulation Applications

APPLICATIONS

 

(a) Sampling of Exponential Distribution

Let the   pdf be  

Let u be random number in (0, 1).

F(x) = u

1 – e - hx = u

e –hx =1- u

- hx = In (1 - u)

x= -1/λ in (1 –u)= - 1/λ

. (·: u is random, replace 1-u by u).

X i = - 1/λ In  ui = 1, 2, : ...

 

Sampling of Gamma Distribution

 

Let xi (i = 1, 2, .... , n) be the exponential random variable with parameter λ They are independent and identically distributed. By a statistical property,

 

T = x1 + x2 + .... + x n be a gamma distributed with the parameter n and 1.. i.e., gamma (n, λ).

 

Then                            T i = -   1/λ in u2 -……1/λ in un ,

 

where ul' u2, .... , un are n random numbers from (0, 1)

 

T i = 1/λ [ In  u1  +In u +… In u n]

 

= - 1/λ in ( u1  u2 …. U3)

=  to generate one gamma sample we need n random numbers from [0, 1].

 

(c) Sampling the Normal Distribution

 

We know that the mean and variance of (0, 1) uniform distribution as 1/2 and1/ 12 respectively.

Consider

 

 

To. generate a sample from N(J..L, cr2). y -11 T- n/2 -<J- =

 

In practice n = 12 is taken, so we get

=  to generate one random sample we need 12 random numbers from (0, 1). b

(d) Evaluation of an Integral I = ʃ f(x) dx (Using Rejection Method)

 

Here f(x) is a continuous curve in [a, b] and also assume that 0≤  f(x)≤  f max·

(i) Generate u1 E [a,b], uniformly distributed random number.

(ii) Generate u2 E [0, fmaxl uniformly distributed rand0m number.

(iii) If u2