Presentation is loading. Please wait.

Presentation is loading. Please wait.

ETM 607 – Random-Variate Generation

Similar presentations


Presentation on theme: "ETM 607 – Random-Variate Generation"— Presentation transcript:

1 ETM 607 – Random-Variate Generation
Inverse-transform technique Exponential Distribution Empirical Continuous Distributions Normal Distribution? Discrete Distributions Empirical Discrete Uniform Geometric Acceptance-Rejection Technique Poisson Process Non-stationary Poisson Process

2 ETM 607 – Random Number and Random Variates
Random-Variate Generation – Chapter 8: Random-Variate generation is converting from a random number (Ri) to a Random Variable, Xi ~ some distribution. Inverse transform method: Step 1 – compute cdf of the desired random variable X Step 2 – Set F(X) = R where R is a random number ~U[0,1) Step 3 – Solve F(X) = R for X in terms of R. X = F-1(R). Step 4 – Generate random numbers Ri and compute desired random variates: Xi = F-1(Ri)

3 ETM 607 – Random-Variate Generation
Recall Exponential distribution: l is often thought of as the arrival rate, and 1/l as the time between arrivals Insert figure 5.9

4 ETM 607 – Random Number and Random Variates
Inverse transform method – Exponential Distribution: Step 1 – compute cdf of the desired random variable X Step 2 – Set F(X) = R where R is a random number ~U[0,1) Step 3 – Solve F(X) = R for X in terms of R. X = F-1(R). Step 4 – Generate random numbers Ri and compute desired random variates:

5 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution: 2 distinct methods: Few observations Many observations

6 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution – Few Observations: Given a random variable X which has an empirical continuous distribution, and the following observed values: First sorting the values smallest to largest, a cdf can be generated, assuming X can take on values between 0 and the largest observed value.

7 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution – Few Observations: Considering the inverse-transform method, one needs to find the slope of each line, ai: And knowing that each line segment begins at x(i-1) , then:

8 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution – Few Observations: In-class Exercise: Create a random-variate generator for the variable X which has an empirical continuous distribution, but assume there are technological reasons the value can never be below 2.5, or above 5.0. Also, the following values were observed: What are the values of X, given random numbers: .05, .27, .75, and .98

9 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution – Many Observations: Major difference from “few observations” approach – don’t use 1/n to construct cdf, use n/N, where N is the total number of observations, and n is the observed number of observations for a given interval of the random variable X. For the slope, ai: (length of the interval) / (relative frequency of observations within the interval) Where ci is the value of the cumulative distribution at xi. See example next slide.

10 ETM 607 – Random Number and Random Variates
Empirical Continuous Distribution – Many Observations: Insert example 8.3

11 ETM 607 – Random Number and Random Variates
Distributions with no closed form cdf: What if a distribution has no closed form cdf (e.g. normal, gamma, beta)? An inverse transform approximation for the Normal Dist.: Insert Table 8.4

12 ETM 607 – Random Number and Random Variates
Discrete Distributions – Empirical: Recall discrete distribution means the random variable X, takes on countable values (integers). For example, observations for the number of shipments per day were: Then, insert fig 8.6 x p(x) F(x) 0.5 1 0.3 0.8 2 0.2 1.0

13 ETM 607 – Random Number and Random Variates
Discrete Distributions – Empirical: Since, insert fig 8.6 Then,

14 ETM 607 – Random Number and Random Variates
Discrete Uniform Distribution: Inclass Exercise Consider a random variable X which follows a uniform discrete distribution between and including the numbers [5,10]. Develop an inverse transform for X with respect to R.

15 ETM 607 – Random Number and Random Variates
Geometric Distribution: Probability mass function (pmf): Cumulative distribution function (cdf):

16 ETM 607 – Random Number and Random Variates
Geometric Distribution: Knowing the cdf: Using the inverse transform method:

17 ETM 607 – Random Number and Random Variates
Random Variate generation for a discrete random variable X with a Poisson Distribution: Recall the pmf: – referred to as the rate parameter (or mean number of occurrences per unit time) Poisson process is the number of arrivals from an exponential inter-arrival stream with mean time (1/l). Then over one unit of time, x arrivals occur if and only if: Where Ai is the inter-arrival time for the ith unit.

18 ETM 607 – Random Number and Random Variates
Random Variate for a Poisson Distribution: Recall inverse transform method for exponential distribution: Then, Becomes: This leads to a acceptance-rejection algorithm.

19 ETM 607 – Random Number and Random Variates
Using: Step 1: Set n = 0, P = 1. Step 2: Generate a random number Rn+1, and replace P by P*Rn+1. Step 3: If P < e-l, then accept N = n. Otherwise, reject the current n, increase n by one, and return to step 2. In Class Exercise, Given X~Poisson(l = 6 arrivals per unit time), use table A.1 (94737, 08225, 35614, 24826, 88319, 05595, 58701, 57365, 74759, etc…) to generate the first value for X for unit time.

20 ETM 607 – Random Number and Random Variates
Nonstationary Poisson Process (NSPP): A poisson arrival process whose arrival rate (li) changes over time. Think “fast food”. Arrival rates at the lunch and dinner hour much greater than arrival rates during “off hours”. Thinning Process: Generates Poisson arrivals at the fastest rate, but “accept” only a portion of the arrivals, in effect thinning out just enough to get the desired time-varying rate.

21 ETM 607 – Random Number and Random Variates
Nonstationary Poisson Process (NSPP): Suppose arrival rates of 10, 5 and 15 for the first three hours. Thinning (in effect) generates arrivals at a rate of 15 for each of the three hours, but accepts approximately 10/15th’s of the arrivals in the first hour and 5/15th’s of the arrivals in the second hour. Original Thinned 1 2 3 1 2 3

22 ETM 607 – Random Number and Random Variates
Nonstationary Poisson Process (NSPP) – Thinning Algorithm: To generate successive arrival time (Ti) when rates vary: Step 1 – Let l* = max{lt} be the maximum arrival rate, and set t = 0and i = 1. Step 2 – Generate E from the exponential distribution with rate l*, and let t = t+E (the arrival time of the next arrival using max rate). Step 3 - Generate random number R from U[0,1). If R < l(t) / l* then Ti = t and i = i + 1. Step 4 – Go to step 2.


Download ppt "ETM 607 – Random-Variate Generation"

Similar presentations


Ads by Google