Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 22

University of Chicago Graduate School of Business

Introduction to Computer Based Models Mr. Schrage

Bus-36102-81 Spring 2003

Notes on Monte Carlo Simulation

(Monte Carlo) Simulation Basic Idea: Operation of a system, including random elements, can be described/modeled by a computer program. Advantages: Can experiment with the simulator much cheaper than with the real system(usually). Can represent arbitrary detail. Disadvantages: Usually too complex to apply optimization such as LP. Can ask only What If, rather than Whats Best.

Example Applications
Boulder 10K Race Telephone call centers Coal loading facility Asian financial options Exxon tanker fleet: Scheduling, sizing, NYFD: Response policies, location, redeployment, staffing Burger King restaurants: Multiple drive-up windows, no. of cashiers IBM inventory simulator GM Production lines American Airlines Reservation System Proposed computer design Military

Useful Ideas/Avoiding Pitfalls a) How to compare two policies the good way.

b) How to generate random variables the good way

c) When can a random variable be replaced by its expectation.

Types of Simulators Transaction processing/trackers e.g., Extend, Witness Replicators, e.g., @Risk, Crystal Ball System Dynamics/Differential Equation e.g., Extend Animation Can work with output log from any of above.

Quick Introduction to the Extend Simulation Program The Extend simulation program allows you to: run one replication of a many period Extend(nonspreadsheet) model. This is in contrast to the @RISK spreadsheet program that allows: run many replications of a single period spreadsheet model. Extend is a very powerful and general purpose simulation program. A slightly simplified description of its capabilities is that it allows to simulate a system in which various entities move through a series of processing steps or blocks, subject to various kinds of random influences. You build an Extend simulation by 1) selecting blocks or processes from a library of blocks, 2) specifying parameters for each block, e.g. the distribution and its mean and standard deviation, and 3) hooking up the blocks to specify how entities flow among blocks.

Bank Teller Simulation in Extend


Tel l er s T count Cust om s com er e i n f r ont door D Tel l er 1 T U Leav e bank # Exi t ( 4) Pl ot t er Pl ot t er U Hel p

V 1 2 Cust om s er

F L W W t i ng Li ne ai

D Tel l er 2 T U

D Tel l er 3

Extend cont.
The first/customer block generates an arrival stream of customers according to some arrival process that you specify. The "waiting line" block simply records how long each customer is in the waiting queue. The teller blocks delay each customer for some random length of time. As with the first block, you can specify the distribution of this delay. The final block simply removes completed customers from the system.

What kind of questions can you answer with a simulation such as this? Some examples are: What's the benefit of adding more tellers? Is it worth the cost? What's the effect of offering specialized service, for example, a "deposits only" teller? What is the effect of reducing the service time, e.g., by increasing the wage rate so that the bank keeps more experienced tellers?

Examining and Controlling an Extend Model You can examine and the parameters that control a block by double clicking on the block. This opens up a dialog box in which you can change parameters, e.g., the mean of a distribution, or the type of the distribution, and see statistics from the most recent run. Under the "Run" menu you can turn on "Show Animation" if you wish to see statistics reported at each block for the current state of the system, e.g., number in queue, etc.

More Information More information on Extend can be found at http://www.imaginethatinc.com/. Another simulation software vendor is Pritsker and Associates, with information at: http://www.pritsker.com/.

Generating Random Numbers, Some Pointers Prob{ Demand = 1] = .21 Prob{ Demand = 2} = .47 Prob{ Demand = 3} = .16 Prob{ Demand = 3} = .16

Generating Random Numbers, Graphically


Cumulative Probability

1.0 .84 .68

.21

Random outcome

Generating Continuous Random Variables


Cumulative Probability

1.0

0 0 1 2 3 4 Random outcome

Generating a Normal deviate!?

Excel 97 uses inverse transform method for Normal,but...

Using the Tools|Data Analysis|Random Number Generator In Excel/Office 2002 Each column used a starting seed = 55.
Unif( 0, 0) N r ( 5, ) 0.0665 7.57 6 .76 06 . 9 7 6. 557 6.0 590 .6 8508 .7 7789 5.8 90 5 5.6 798 9.509 6 9.96 707 .79 58 .8 5 67 0.7 9 0.6 5 0. 05 5 9. 868 5 6. 8869 5.876 9 9. 0 87 9. 605 9. 5 65 9. 6 5 9 .9 98 . 6 7 7.8 060 7. 7 6 8.75576 8. 59 59 isson( 5) Binom(.75, 0) B rnoulli(.5) 5 7 7

0 0 0

8 5 6 9 8 8 6

6 5 6 6 6

0 0 0 0 0

Quasi-Random Numbers An important variance reduction method in Monte Carlo. Available in @Risk and other simulators as an option.

Suppose I want to run 9 replications, one random variable per replication. How should I generate the 9 uniforms? (Make sure you get one in each interval, make super-uniform)

Quasi-Random Numbers, continued Suppose I want to run 9 replications, Need two random variables per replication. How should I generate the 9 pairs of uniforms? 1

0 0 1

Numerical Examples
Applichem Case: How to best serve six international markets in the face of random demand, and random foreign exchange rates.
Design of experiment: 4096 scenarios(12 random variables each), 100 replications.
Method: Random Antithetic Mean: 1145.739 1145.427 Std Error: 2.834 1.348 Stratified Weyl LH SLH 1145.549 1145.274 1145.217 1145.288 1.717 2.609 0.815 0.663

Because we are maximizing profit, an optimizing simulation will have a slight optimistic bias. Why?

Numerical Examples, cont. Pricing a EurAsian option,


i.e., Value = max(0, average_price_til_maturity strike_price).
Design of experiment: 1024 scenarios(10 periods to maturity), 200 replications. LH SLH Method: Random Antithetic Stratified Weyl Mean: 1.8972 1.8946 1.8896 1.8807 1.8902 1.8897 Std Error: 0.0811 0.0578 0.0554 0.1133 0.0373 0.0302

You might also like