Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.

Slides:



Advertisements
Similar presentations
Outline input analysis input analyzer of ARENA parameter estimation
Advertisements

Eastern Mediterranean University Department of Industrial Engineering IENG461 Modeling and Simulation Systems Computer Lab 2 nd session ARENA (Input Analysis)
Chapter 5 Statistical Models in Simulation
Probability and Statistics Dr. Saeid Moloudzadeh Frequency table and graphs 1 Contents Descriptive Statistics Axioms of Probability Combinatorial.
CPSC 531:Random-Variate Generation
Chapter 8 Random-Variate Generation
Random-Variate Generation. Need for Random-Variates We, usually, model uncertainty and unpredictability with statistical distributions Thereby, in order.
Simulation Modeling and Analysis
Probability Densities
Simulation Modeling and Analysis
Agenda Purpose Prerequisite Inverse-transform technique
Random-Variate Generation. 2 Purpose & Overview Develop understanding of generating samples from a specified distribution as input to a simulation model.
28-1 ©2006 Raj Jain Random Variate Generation.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 4 Continuous Random Variables and Probability Distributions.
Properties of Random Numbers
4-1 Continuous Random Variables 4-2 Probability Distributions and Probability Density Functions Figure 4-1 Density function of a loading on a long,
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
Chapter 4 Continuous Random Variables and Probability Distributions
ETM 607 – Random Number and Random Variates
Chapter 5 Modeling & Analyzing Inputs
Chapter 5 Statistical Models in Simulation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Graduate Program in Engineering and Technology Management
 1  Outline  stages and topics in simulation  generation of random variates.
Functions of Random Variables. Methods for determining the distribution of functions of Random Variables 1.Distribution function method 2.Moment generating.
CPSC 531: Probability Review1 CPSC 531:Distributions Instructor: Anirban Mahanti Office: ICT Class Location: TRB 101.
0 Simulation Modeling and Analysis: Input Analysis K. Salah 8 Generating Random Variates Ref: Law & Kelton, Chapter 8.
Chapter 5 Statistical Models in Simulation
Continuous Probability Distributions  Continuous Random Variable  A random variable whose space (set of possible values) is an entire interval of numbers.
Modeling and Simulation CS 313
Modeling and Simulation Input Modeling and Goodness-of-fit tests
Chapter 9 Input Modeling
Moment Generating Functions
Traffic Modeling.
Functions of Random Variables. Methods for determining the distribution of functions of Random Variables 1.Distribution function method 2.Moment generating.
2 Input models provide the driving force for a simulation model. The quality of the output is no better than the quality of inputs. We will discuss the.
CPSC 531:Input Modeling Instructor: Anirban Mahanti Office: ICT 745
1 Statistical Distribution Fitting Dr. Jason Merrick.
Chapter 7 Random-Number Generation
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
Use of moment generating functions 1.Using the moment generating functions of X, Y, Z, …determine the moment generating function of W = h(X, Y, Z, …).
Ch5. Probability Densities II Dr. Deshi Ye
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Continuous Random Variables.
LECTURE 25 SIMULATION AND MODELING Md. Tanvir Al Amin, Lecturer, Dept. of CSE, BUET CSE 411.
Chapter 9 Input Modeling Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
4-1 Continuous Random Variables 4-2 Probability Distributions and Probability Density Functions Figure 4-1 Density function of a loading on a long,
Selecting Input Probability Distribution. Simulation Machine Simulation can be considered as an Engine with input and output as follows: Simulation Engine.
ETM 607 – Random-Variate Generation
Starting point for generating other distributions.
Random Variable The outcome of an experiment need not be a number, for example, the outcome when a coin is tossed can be 'heads' or 'tails'. However, we.
Input Modeling for Simulation Chapter 3 “As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they.
Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Chapter 9 Input Modeling
2 Input models provide the driving force for a simulation model. The quality of the output is no better than the quality of inputs. In this chapter, we.
Chapter 20 Statistical Considerations Lecture Slides The McGraw-Hill Companies © 2012.
Gil McVean, Department of Statistics Thursday February 12 th 2009 Monte Carlo simulation.
Selecting Input Probability Distributions. 2 Introduction Part of modeling—what input probability distributions to use as input to simulation for: –Interarrival.
Generating Random Variates
Modeling and Simulation CS 313
4-1 Continuous Random Variables 4-2 Probability Distributions and Probability Density Functions Figure 4-1 Density function of a loading on a long,
Random number generation
Modeling and Simulation CS 313
Chapter 9 Input Modeling
Subject Name: SYSTEM MODELING AND SIMULATION [UNIT-7 :INPUT MODELING]
Chapter 5 Statistical Models in Simulation
Random-Variate Generation
Chapter 8 Random-Variate Generation
LESSON 8: RANDOM VARIABLES EXPECTED VALUE AND VARIANCE
Random Variate Generation
Chapter 6 Continuous Probability Distributions
Generating Random Variates
Presentation transcript:

Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

2 Purpose & Overview Develop understanding of generating samples from a specified distribution as input to a simulation model. Illustrate some widely-used techniques for generating random variates.  Inverse-transform technique  Acceptance-rejection technique  Special properties

3 Inverse-transform Technique The concept:  For cdf function: r = F(x)  Generate r from uniform (0,1)  Find x: x = F -1 (r) r1r1 x1x1 r = F(x)

4 Exponential Distribution [Inverse-transform] Exponential Distribution:  Exponential cdf:  To generate X 1, X 2, X 3 … r = F(x) = 1 – e - x for x  0 X i = F -1 (R i ) = -(1/  ln(1-R i ) [Eq’n 8.3] Figure: Inverse-transform technique for exp( = 1)

5 Exponential Distribution [Inverse-transform] Example: Generate 200 variates X i with distribution exp( = 1)  Generate 200 Rs with U(0,1) and utilize the following equation:  Where  Check: Does the random variable X 1 have the desired distribution?

Exponential Distribution [Inverse-transform] Histogram for 200 R i : (empirical) (theoretical) 6

Exponential Distribution [Inverse-transform] Histogram for 200 X i : (empirical) (theoretical) 7

Exponential Distribution [Inverse-transform] Generate using the graphical view: 8

Exponential Distribution [Inverse-transform] Draw a horizontal line from R 1 (randomly generated), find to corresponding x to obtain X 1. We can see that:  when and only when so :  so : 9

10 Other Distributions [Inverse-transform] Examples of other distributions for which inverse cdf works are:  Uniform distribution  Weibull distribution (v = 0)

Other Distributions [Inverse-transform]  Triangular distribution 11

12 Empirical Continuous Dist’n [Inverse-transform] When theoretical distribution is not applicable To collect empirical data:  Resample the observed data  Interpolate between observed data points to fill in the gaps For a small sample set (size n):  Arrange the data from smallest to largest  Assign the probability 1/n to each interval where

13 Empirical Continuous Dist’n [Inverse-transform] Five observations of fire-crew response times (in mins.): 

Empirical Continuous Dist’n [Inverse-transform] 14 Consider R 1 = 0.71: (i-1)/n = 0.6 < R 1 < i/n = 0.8 X 1 = x (4-1) + a 4 (R 1 – (4-1)/n) = ( ) = 1.66

Empirical Continuous Dist’n [Inverse-transform] For a large sample set :  Summarize into frequency distribution with small number of intervals. (equal intervals) x (i-1) < x ≤ x (i) : i th interval  Fit a continuous empirical cdf to the frequency distribution. if c i-1 < R ≤ c i (ci : cumulative frequency) Where 15

16 Empirical Continuous Dist’n [Inverse-transform] Example: Suppose the data collected for100 broken- widget repair times are: Consider R 1 = 0.83: c 3 = 0.66 < R 1 < c 4 = 1.00 X 1 = x (4-1) + a 4 (R 1 – c (4-1) ) = ( ) = 1.75

17 Discrete Distribution [Inverse-transform] All discrete distributions can be generated via inverse-transform technique Method: numerically, table-lookup procedure, algebraically, or a formula Examples of application:  Empirical  Discrete uniform  Gamma

18 Discrete Distribution [Inverse-transform] Example: Suppose the number of shipments, x, on the loading dock of IHW company is either 0, 1, or 2  Data - Probability distribution:  Method - Given R, the generation scheme becomes: Consider R 1 = 0.73: F(x i-1 ) < R <= F(x i ) F(x 0 ) < 0.73 <= F(x 1 ) Hence, x 1 = 1

19 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 Generate R Condition Output R’ yes no

20 NSPP [Acceptance-Rejection] Non-stationary Poisson Process (NSPP): a Possion arrival process with an arrival rate that varies with time Idea behind thinning:  Generate a stationary Poisson arrival process at the fastest rate, * = max (t)  But “accept” only a portion of arrivals, thinning out just enough to get the desired time-varying rate Generate E ~ Exp( *) t = t + E Condition R <= (t) Output E ’~ t yes no

21 NSPP [Acceptance-Rejection] Example: Generate a random variate for a NSPP Procedures: Step 1. * = max (t) = 1/5, t = 0 and i = 1. Step 2. For random number R = , E = -5ln(0.213) = t = Step 3. Generate R = (13.13)/ *=(1/15)/(1/5)=1/3 Since R>1/3, do not generate the arrival Step 2. For random number R = , E = -5ln(0.553) = 2.96 t = = Step 3. Generate R = (16.09)/ *=(1/15)/(1/5)=1/3 Since R<1/3, T 1 = t = 16.09, and i = i + 1 = 2 Data: Arrival Rates

22 Special Properties Based on features of particular family of probability distributions For example:  Direct Transformation for normal and lognormal distributions  Convolution  Beta distribution (from gamma distribution)

23 Direct Transformation [Special Properties] Approach for normal(0,1):  Consider two standard normal random variables, Z 1 and Z 2, plotted as a point in the plane:  B 2 = Z Z 2 2 ~ chi-square distribution with 2 degrees of freedom = Exp( = 2). Hence,  The radius B and angle  are mutually independent. In polar coordinates: Z 1 = B cos  Z 2 = B sin 

24 Direct Transformation [Special Properties] Approach for normal( ,   ):  Generate Z i ~ N(0,1) Approach for lognormal( ,   ):  Generate X ~ N( ,   ) Y i = e X i X i =  +  Z i

25 Summary Principles of random-variate generate via  Inverse-transform technique  Acceptance-rejection technique  Special properties Important for generating continuous and discrete distributions