Example 2
Simulate the exponential distribution P(x)=?e- ?x, xɬ
with uniform random generator.
? 1– u = e- ?x, log (1-u) = - ?x, x = – (1/?) log (1-u)
Step 2. Generate a uniform r.v. x (value in [0, 1]) using
generator in C, C++, Java, Minitab or SAS etc.
Step 3. Calculate x through equation from Step 1.
Step 4. Repeat Step 2 & 3 n times (e.g. 1000 observations).
[Step 5.] Calculate mean and standard deviation etc.