1 / 18

Random-Variate Generation

Random-Variate Generation. Need for Random-Variates. We, usually, model uncertainty and unpredictability with statistical distributions Thereby, in order to run the simulation models involving uncertainty, we need to get samples from these statistical distributions

nathan
Download Presentation

Random-Variate Generation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Random-Variate Generation

  2. Need for Random-Variates • We, usually, model uncertainty and unpredictability with statistical distributions • Thereby, in order to run the simulation models involving uncertainty, we need to get samples from these statistical distributions • Here, we assume that the distributions (type and parameters) are already specified • ARENA comes with ready functions to sample from specified distributions. • It is still useful to know how it is done • We will generate the variates always using random numbers, whose generation is discussed previously

  3. Inverse Transform Technique -- Exponential Distribution • To generate samples from exponential distribution we use the inverse transform technique Step 1. Compute the cdf of the desired random variable X, F(x). Step 2. Find the inverse of F(x) function Step 4. Generate uniform random variables R1, R2, R3, … and compute the desired random variates by

  4. Inverse Transform Technique -- Exponential Distribution

  5. Inverse Transform Technique -- Exponential Distribution • Example: Generate 200 variates Xi with distribution exp(l= 1) • Check: Does the random variable X1 have the desired distribution?

  6. Proof? • Can you prove that the numbers you have generated are indeed samples from an exponential distribution?

  7. Other Distributions • Uniform Distribution [ UN(a,b)] (X = a + (b-a)R) • Does it really work? • Weibull Distribution • Derive the transformation • Triangular …. • The moral is if we can find a closed-form inverse of the cdf for a distribution we can use this method to get samples from that distribution

  8. Continuous Functions without a Closed-Form Inverse • Some distributions do not have a closed form expression for their cdf or its inverse (normal, gamma, beta, …) • What can be done then? • Approximate the inverse cdf • For the standard normal distribution: • This approximation gives at least one-decimal place accuracy in the range [0.0012499, 0.9986501]

  9. Discrete Distributions • An Empirical Discrete Distribution • p(0) = P(X=0) = 0.50 • p(1) = P(X=1) = 0.30 • p(2) = P(X=2) = 0.20 • Can we apply the inverse transform technique?

  10. Discrete Distributions • Let x0 = -, and x1, x2, …, xn, be the ordered probability mass points for the random variable X • Let R be a random number

  11. Discrete Distributions • A Discrete Uniform Distribution

  12. Discrete Distributions • The Geometric Distribution • Some algebraic manipulation and …

  13. Generate R no Condition yes Output R’ 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) • 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. Procedures: Step 1. Generate R ~ U[0,1] Step 2a. If R >= ¼, accept X=R. Step 2b. If R < ¼, reject R, return to Step 1

  14. Acceptance-Rejection Technique • Poisson Distribution • N can be interpreted as number of arrivals from a Poisson arrival process during one unit of time • Then time between the arrivals in the process are exponentially distributed with rate 

  15. Acceptance-Rejection Technique • Step 1. Set n = 0, and P = 1 • Step 2. Generate a random number Rn+1 and let P = P. Rn+1 • Step 3. If P < e-, then accept N = n. Otherwise, reject current n, increase n by one, and return to step 2 • How many random numbers will be used on the average to generate one Poisson variate?

  16. Direct Transformations • Consider two normal variables Z1 and Z2

  17. Direct Transformation • Approach fornormal(m,s2): • Generate Zi ~ N(0,1) • Approach for lognormal(m,s2): • Generate X ~ N(m,s2) Xi = m + s Zi Yi = eXi

  18. Convolution Method • Erlang Distribution • An Erlang-K random variable X with parameters (K, ) (1/ is the mean, K is the stage number) can be obtained by summing K independent exponential random variables each having mean 1/(K )

More Related