Presentation is loading. Please wait.

Presentation is loading. Please wait.

EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp.

Similar presentations


Presentation on theme: "EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp."— Presentation transcript:

1 EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp

2 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-2 Session 4 Outline Part 1: Monte Carlo Simulations. Part 2: Queuing Theory. Part 3: Linear Programming – Graphical Techniques. Part 4: Linear Programming – Computer Techniques.

3 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-3 Today’s Session Topics Part 1: Monte Carlo Simulations.

4 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-4 Monte Carlo Simulation The purpose of a Monte Carlo simulation is to generate sample data for statistical analysis –Carefully designed physical experiments. –Table of random digits (Rand Corporation). Today, Monte Carlo simulation is often performed by computers. Computers don’t really generate random numbers – they generate pseudo random numbers using arithmetic algorithms.

5 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-5 Lehmer’s Algorithm – Minimum Standard Generator The core algorithm for random number generation produces uniform random numbers on the interval 0 – 1, U(0,1). Lehmer developed the Multiplicative Congruential Generators The problem has been studied for a long time for good values for a and m… the result is the following “good” algorithm: The seed is turned into a uniform random number via

6 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-6 Computer Code double uniform(void) { static int z = 1; // Random seed const int a = 16807; const int m = 2147483647; const int q = 1127773; // = m / a const r = 2836; // = m mod a temp1 = z / q; temp2 = z % q; // = z mod q z = a * temp1 – r * temp2; z = (z > 0) ? z : z + m; return z / m; }

7 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-7 Non-Uniform Random Numbers Random numbers from other distributions are generated using several methods. –Method 1: Percentile Transformation. –Method 2: Rejection Method. –Method 3: Use known relationships between the variable to be generated and either the standard normal N(0,1) or uniform U(0,1) random variables.

8 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-8 Percentile Transformation Desire variable X to have a PDF f X (x) and CDF F X (x) –Then X = F -1 X (U) will have the desired distribution where U is uniform random variable U(0,1). This works because U = F X (X) is uniformly distributed and all CDFs are monotonic. Example: Generate an exponential random variable from a uniform random variable:

9 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-9 Table of Percentile Transforms DistributionCDF -1 Excel Built-in Beta BETAINV(RAND(), ,  ) Chi-squareCHIINV(RAND(), n) Exponential -LN(RAND()) / FFINV(RAND(), n, m) Gamma GAMMAINV(RAND(), ,  ) Log-Normal LOGINV(RAND(), ,  ) Normal NORMINV(RAND(), ,  ) Rayleigh SQRT(-  *LN(RAND())) TTINV(RAND(), n) Weibull ((-LN(RAND())) ^ (1/  )) /

10 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-10 Rejection Method The percentile transform requires a closed form (or closed form numerical approximation) of the CDF. Start with two independent random variables Y ~ F Y (y)U ~ U(0,1) To generate a random variable X with CDF F X (x) –Find a, –If then assign X = Y.

11 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-11 Box-Muller Transform Start with two independent uniform random variables U ~ U(0,1)V ~ U(0,1) Compute Then X and Y are mutually independent standard Normal random variables N(0,1).

12 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-12 Monte Carlo Simulation Steps Determine the time characteristic to simulate –Instantaneous (one shot) –Fixed time increment –Fixed event increment Determine important random variables and their distributions –Plot sample data on probability paper. –If no distribution fits, don’t hesitate to use a lookup table based on the emperical CDF (discussed in text).

13 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-13 How many runs? The larger the number of trials in the simulation, the more precise will be the final answer. –Any estimate will have an associated error band. –In practice, the allowable error is generally specified, and this information is used to determine the required trials. –The procedure is to use a priori knowledge and solve a corresponding confidence interval for n, the number of samples.

14 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-14 How many runs? Example: Monte Carlo simulation to determine the number of successes. –p o is the initial gestimate of the population proportion –Use p o = 0.5 to obtain the most conservative number –Pick , the desired confidence level desired margin of error z-score

15 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-15 Simulation Pros Flexibility. Easy to ask “what-ifs?” Can find for the properties of very complex systems including complicated details which do not yield well to quantitative, closed-form solutions. No interference with the “real world.” Existing operations go about their business while “what-ifs” are asked in the computer lab. Time compression.

16 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-16 Simulation Cons Lack of interference from the “real world” can result in a solution which has only academic value. A great deal of computer time may be needed to obtain the desired accuracy. The entire simulation must be redone for a change in a single variable or discovery of a programming error. Good simulations of complex problems require complex and expensive computer programs. These complex and expensive computer problems are one trick ponies and cannot solve any other problem.

17 EMIS 7300 Fall 2005 Copyright  2005 Dr. John Lipp S4P1-17 Homework Pick 1 of 3 computer simulation projects: 1.Good Experiment Gone Bad. 2.Verify Queuing Model Equations. 3.Reliable Design. (I am open to other projects of similar complexity) Notes: You must use a computing language I have access to (C, C++, MATLAB, FORTRAN). If you aren’t much of a programmer, try a tool such as Crystal Ball (http://www.decisioneering.com).


Download ppt "EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp."

Similar presentations


Ads by Google