58
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science 4 th edition Cliff T. Ragsdale

Spreadsheet Modeling & Decision Analysis

Embed Size (px)

DESCRIPTION

Spreadsheet Modeling & Decision Analysis. A Practical Introduction to Management Science 4 th edition Cliff T. Ragsdale. Chapter 12. Introduction to Simulation Using Crystal Ball. Introduction to Simulation. - PowerPoint PPT Presentation

Citation preview

Page 1: Spreadsheet Modeling & Decision Analysis

Spreadsheet Modeling & Decision Analysis

A Practical Introduction to Management Science

4th edition

Cliff T. Ragsdale

Page 2: Spreadsheet Modeling & Decision Analysis

12-2

Introduction to Simulation Using Crystal Ball

Chapter 12

Page 3: Spreadsheet Modeling & Decision Analysis

12-3

Introduction to Simulation

• In many spreadsheets, the value for one or more cells representing independent variables is unknown or uncertain.

• As a result, there is uncertainty about the value the dependent variable will assume:

Y = f(X1, X2, …, Xk)

• Simulation can be used to analyze these types of models.

Page 4: Spreadsheet Modeling & Decision Analysis

12-4

Random Variables & Risk

• A random variable is any variable whose value cannot be predicted or set with certainty.

• Many “input cells” in spreadsheet models are actually random variables.– the future cost of raw materials– future interest rates– future number of employees in a firm– expected product demand

• Decisions made on the basis of uncertain information often involve risk.

• “Risk” implies the potential for loss.

Page 5: Spreadsheet Modeling & Decision Analysis

12-5

More examples on risk:

• If there are no variation (i.e., risk) in investment, what would happen?

• What do insurance companies offer?

• As you are applying graduate study in U.S., what are the main factors you consider? For example, the % of getting admission varies a lot or holds steady.

Page 6: Spreadsheet Modeling & Decision Analysis

12-6

Why Analyze Risk?• Plugging in expected values for uncertain cells

tells us nothing about the variability of the performance measure we base decisions on.

• Suppose an $1,000 investment is expected to return $10,000 in two years. Would you invest if...– the outcomes could range from $9,000 to $11,000?– the outcomes could range from -$30,000 to

$50,000?

• Alternatives with the same expected value may involve different levels of risk.

Page 7: Spreadsheet Modeling & Decision Analysis

12-7

SUPPOSE YOU COULD CHOOSE TO PLAY ONE OF TWO GAMES: (Are you rational?)

Game A

There is a

10% chance that you will win $1,000,000….and a

90% chance that you will win

$50,000.

Game B

There is a

10% chance that you will win $2,000,000….and a

90% chance that you will win

$0.

Which would you choose?

Page 8: Spreadsheet Modeling & Decision Analysis

12-8

Game A

There is a

10% chance that you will win $1,000,000….and a

90% chance that you will win

$50,000.

Game B

There is a

10% chance that you will win $2,000,000….and a

90% chance that you will win

$0.

expected value =

(.1)(1,000,000)+

(.9)(50,000) =

145,000

expected value =

(.1)(2,000,000)+

(.9)(0) =

200,000

Page 9: Spreadsheet Modeling & Decision Analysis

12-9

• Question: Why do people tend to choose the action with lower expected value?

My explanation is that people are willing to sacrifice some in the average value, in exchange for a more stable result.

Question: What are the variations in the two games described above?

Note: The previous game is called “Paradox of Alais.”

Page 10: Spreadsheet Modeling & Decision Analysis

12-10

Methods of Risk Analysis

• Best-Case/Worst-Case Analysis• What-if Analysis• Simulation

Page 11: Spreadsheet Modeling & Decision Analysis

12-11

Best-Case/Worst-Case Analysis

• Best case - plug in the most optimistic values for each of the uncertain cells.

• Worst case - plug in the most pessimistic values for each of the uncertain cells.

• This is easy to do but tells us nothing about the distribution of possible outcomes within the best and worst-case limits.

Page 12: Spreadsheet Modeling & Decision Analysis

12-12

Possible Performance Measure Distributions Within a Range

worst case best case

worst case best case

worst case best case

worst case best case

Page 13: Spreadsheet Modeling & Decision Analysis

12-13

What-If Analysis• Plug in different values for the uncertain cells

and see what happens.• This is easy to do with spreadsheets.• Problems:

– Values may be chosen in a biased way.– Hundreds or thousands of scenarios may be

required to generate a representative distribution.– Does not supply the tangible evidence (facts and

figures) needed to justify decisions to management.

Page 14: Spreadsheet Modeling & Decision Analysis

12-14

Simulation• Resembles automated what-if analysis.• Values for uncertain cells are selected in an

unbiased manner.• The computer generates hundreds (or

thousands) of scenarios.• We analyze the results of these scenarios to

better understand the behavior of the performance measure.

• This allows us to make decisions using solid empirical evidence.

Page 15: Spreadsheet Modeling & Decision Analysis

12-15

Page 16: Spreadsheet Modeling & Decision Analysis

12-16

History of Monte Carlo simulation

• How did Monte Carlo simulation get its name?

• The name and the systematic development of Monte Carlo methods dates from about 1940’s.

• There are however a number of isolated and undeveloped instances on much earlier occasions.

Page 17: Spreadsheet Modeling & Decision Analysis

12-17

History of Monte Carlo simulation (cont.)

• In the second half of the nineteenth century a number of people performed experiments, in which they threw a needle in a haphazard manner onto a board ruled with parallel straight lines and inferred the value of PI =3.14… from observations of the number of intersections between needle and lines.

• In 1899 Lord Rayleigh showed that a one-dimensional random walk without absorbing barriers could provide an approximate solution to a parabolic differential equation.

Page 18: Spreadsheet Modeling & Decision Analysis

12-18

Buffon's original form was to drop a needle of length L at random on grid of parallel lines of spacing D.

For L less than or equal D we obtain P(needle intersects the grid) = 2 • L / PI • D.

If we drop the needle N times and count R intersections we obtain

P = R / N, PI = 2 • L • N / R • D.

Page 19: Spreadsheet Modeling & Decision Analysis

12-19

Page 20: Spreadsheet Modeling & Decision Analysis

12-20

Page 21: Spreadsheet Modeling & Decision Analysis

12-21

Page 22: Spreadsheet Modeling & Decision Analysis

12-22

Page 23: Spreadsheet Modeling & Decision Analysis

12-23

Page 24: Spreadsheet Modeling & Decision Analysis

12-24

History of Monte Carlo simulation (cont.)• In early part of the twentieth century, British

statistical schools indulged in a fair amount of unsophisticated Monte Carlo work.

• In 1908 Student (W.S. Gosset) used experimental sampling to help him towards his discovery of the distribution of the correlation coefficient.

• In the same year Student also used sampling to bolster his faith in his so-called t-distribution, which he had derived by a somewhat shaky and incomplete theoretical analysis.

Page 25: Spreadsheet Modeling & Decision Analysis

12-25

Student - William Sealy Gosset (1876 - 1937)

This birth-and-death process is suffering from labor pains; it will be the death of me yet. (Student Sayings)

Page 26: Spreadsheet Modeling & Decision Analysis

12-26

In 1931 Kolmogorov showed the relationship between Markov stochastic processes and certain integro-differential equations.

A. N. Kolmogorov (1903-1987)

Page 27: Spreadsheet Modeling & Decision Analysis

12-27

History of Monte Carlo simulation (cont.)• The real use of Monte Carlo methods as a research

tool stems from work on the atomic bomb during the second world war.

• This work involved a direct simulation of the probabilistic problems concerned with random neutron diffusion in fissile material; but even at an early stage of these investigations, von Neumann and Ulam refined this particular "Russian roulette" and "splitting" methods. However, the systematic development of these ideas had to await the work of Harris and Herman Kahn in 1948.

• About 1948 Fermi, Metropolis, and Ulam obtained Monte Carlo estimates for the eigenvalues of Schrodinger equation.

Page 28: Spreadsheet Modeling & Decision Analysis

12-28

John von Neumann (1903-1957)

Page 29: Spreadsheet Modeling & Decision Analysis

12-29

History of Monte Carlo simulation (cont.)• In about 1970, the newly developing theory of

computational complexity began to provide a more precise and persuasive rationale for employing the Mont Carlo method.

• Karp (1985) shows this property for estimating reliability in a planar multiterminal network with randomly failing edges.

• Dyer (1989) establish it for estimating the volume of a convex body in M-dimensional Euclidean space.

• Broder (1986) and Jerrum and Sinclair (1988) establish the property for estimating the permanent of a matrix or, equivalently, the number of perfect matchings in a bipartite graph.

Page 30: Spreadsheet Modeling & Decision Analysis

12-30

Example: Hungry Dawg Restaurants

• Hungry Dawg is a growing restaurant chain with a self-insured employee health plan.

• Covered employees contribute $125 per month to the plan, Hungry Dawg pays the rest.

• The number of covered employees changes from month to month.

• The number of covered employees was 18,533 last month and this is expected to increase by 2% per month.

• The average claim per employee was $250 last month and is expected to increase at a rate of 1% per month.

Page 31: Spreadsheet Modeling & Decision Analysis

12-31

Implementing the Model

See file Fig12-2.xls

Page 32: Spreadsheet Modeling & Decision Analysis

12-32

Questions About the Model• Will the number of covered employees really

increase by exactly 2% each month?• Will the average health claim per employee

really increase by exactly 1% each month?• How likely is it that the total company cost will

be exactly $36,125,850 in the coming year?• What is the probability that the total company

cost will exceed, say, $38,000,000?

Page 33: Spreadsheet Modeling & Decision Analysis

12-33

Using simulation, the management wants to determine the average time a customer must wait for service!!

Page 34: Spreadsheet Modeling & Decision Analysis

12-34

Simulation• To properly assess the risk inherent in

the model we need to use simulation.• Simulation is a 4 step process:

1) Identify the uncertain cells in the model.

2) Implement appropriate RNGs for each uncertain cell.

3) Replicate the model n times, and record the value of the bottom-line performance measure.

4) Analyze the sample values collected on the performance measure.

Page 35: Spreadsheet Modeling & Decision Analysis

12-35

What is Crystal Ball?

• Crystal Ball is a spreadsheet add-in that simplifies spreadsheet simulation.

• A 120-day trial version of Crystal Ball is on the CD-ROM accompanying this book.

• It provides:– functions for generating random numbers– commands for running simulations– graphical & statistical summaries of simulation

data

• For more info see:http://www.decisioneering.com

Page 36: Spreadsheet Modeling & Decision Analysis

12-36

Random Number Generators (RNGs)

• A RNG is a mathematical function that randomly generates (returns) a value from a particular probability distribution.

• We can implement RNGs for uncertain cells to allow us to sample from the distribution of values expected for different cells.

Page 37: Spreadsheet Modeling & Decision Analysis

12-37

How RNGs Work• The RAND( ) function returns uniformly

distributed random numbers between 0.0 and 0.9999999.

• Suppose we want to simulate the act of tossing a fair coin.

• Let 1 represent “heads” and 2 represent “tails”.

• Consider the following RNG:

=IF(RAND( )<0.5,1,2)

Page 38: Spreadsheet Modeling & Decision Analysis

12-38

Simulating the Roll of a Die• We want the values 1, 2, 3, 4, 5 & 6 to occur

randomly with equal probability of occurrence.• Consider the following RNG:

=INT(6*RAND())+1

If 6*RAND( ) falls INT(6*RAND( ))+1 in the interval: returns the value:

0.0 to 0.999 11.0 to 1.999 22.0 to 2.999 33.0 to 3.999 44.0 to 4.999 55.0 to 5.999 6

Page 39: Spreadsheet Modeling & Decision Analysis

12-39

Some of the RNGs Provided By Crystal Ball

Distribution RNG FunctionBinomial CB.Binomial(p,n)Custom CB.Custom(range)Gamma

CB.Gamma(loc,shape,scale,min,max)Poisson CB.Poisson(l)Continuous Uniform CB.Uniform(min,max)Exponential CB.Exponential(l)Normal CB.Normal(m,s,min,max)Triangular CB.Triang(min, most likely, max)

Page 40: Spreadsheet Modeling & Decision Analysis

12-40

Examples of Discrete Probability Distributions

0.00

0.10

0.20

0.30

0.40

0 1 2 3 4 5 6 7 8 9 10

CB.Binomial(0.2,10)

0.00

0.10

0.20

0.30

0.40

0 1 2 3 4 5 6 7 8 9 10

CB.Binomial(0.5,10)

0.00

0.10

0.20

0.30

0.40

0 1 2 3 4 5 6 7 8 9 10

CB.Binomial(0.8,10)

0.00

0.10

0.20

0.30

0.40

0.50

20 21 22 23

CB.Custom(range)

0.00

0.10

0.20

0.30

0.40

0.50

20 21 22 23

INT(CB.Uniform(20,24))

0.00

0.10

0.20

0.30

0.40

0 1 2 3 4 5 6 7 8 9 10

CB.Poisson(0.9)

0.00

0.10

0.20

0.30

0.40

0 1 2 3 4 5 6 7 8 9 10

CB.Poisson(2)

0.00

0.10

0.20

0.30

0.40

0 2 4 6 8 10 12 14 16 18 20

CB.Poisson(8)

Page 41: Spreadsheet Modeling & Decision Analysis

12-41

Examples of Continuous Probability Distributions

CB.Normal(20,1.5)

0.000.050.100.150.200.250.30

12 14 16 18 20 22 24 26 28

CB.Normal(20,3)

0.000.050.100.150.200.250.30

12 14 16 18 20 22 24 26 28

CB.Normal(20,3,15,23)

0.000.050.100.150.200.250.30

11 13 15 17 19 21 23 25 27 29

CB.Gamma(0,1,2)

0.000.100.200.300.400.50

0 2 4 6 8 10 12

CB.Gamma(0,5,2)

0.000.100.200.300.400.50

0 2 4 6 8 10 12 14 16 18

CB.Exponential(5)

0.000.10

0.200.30

0.400.50

0 2 4 6 8 10

CB.Triangular(3,4,8)

0.00

0.10

0.20

0.30

0.40

0.50

2.5 3.5 4.5 5.5 6.5 7.5 8.5

CB.Triangular(3,7,8)

0.00

0.10

0.20

0.30

0.40

0.50

2.5 3.5 4.5 5.5 6.5 7.5 8.5

CB.Uniform(40,60)

0.00

0.05

0.10

0.15

30.0 40.0 50.0 60.0 70.0

Page 42: Spreadsheet Modeling & Decision Analysis

12-42

Discrete vs. Continuous Random Variables

• A discrete random variable may assume one of a fixed set of (usually integer) values.– Example: The number of defective tires on a

new car can be 0, 1, 2, 3, or 4.

• A continuous random variable may assume one of an infinite number of values in a specified range.– Example: The amount of gasoline in a new

car can be any value between 0 and the maximum capacity of the fuel tank.

Page 43: Spreadsheet Modeling & Decision Analysis

12-43

Preparing the Model for Simulation

• Suppose we analyzed historical data and found that:– The change in the number of covered

employees each month is uniformly distributed between a 3% decrease and a 7% increase.

– The average claim per employee follows a normal distribution with mean increasing by 1% per month and a standard deviation of $3.

Page 44: Spreadsheet Modeling & Decision Analysis

12-44

Revising & Simulating the Model

See file Fig12-8.xls

Page 45: Spreadsheet Modeling & Decision Analysis

12-45

The Uncertainty of Sampling

• The replications of our model represent a sample from the (infinite) population of all possible replications.

• Suppose we repeated the simulation and obtained a new sample of the same size. Q: Would the statistical results be the same?A: No!

• As the sample size (# of replications) increases, the sample statistics converge to the true population values.

• We can also construct confidence intervals for a number of statistics...

Page 46: Spreadsheet Modeling & Decision Analysis

12-46

Constructing a Confidence Interval for the True Population Mean

n

s.-y 961 =Limit ConfidenceLower 95%

n

s.y 961 =Limit Confidence Upper 95%

y

s

n n

the sample mean

= the sample standard deviation

= the sample size (and 30)

where:

Note that as n increases, the width of the confidence interval

decreases.

Page 47: Spreadsheet Modeling & Decision Analysis

12-47

Constructing a Confidence Interval for the True Population Proportion

n

pp.-p

)1(961 =Limit ConfidenceLower 95%

p

n np

the proportion of the sample that is less than some value Y

= the sample size (and 30)

where:

n

pp.p

)1(961 =Limit Confidence Upper 95%

Note again that as n increases, the width of the confidence interval

decreases.

Page 48: Spreadsheet Modeling & Decision Analysis

12-48

Additional Uses of Simulation

• Simulation is used to describe the behavior, distribution and/or characteristics of some bottom-line performance measure when values of one or more input variables are uncertain.

• Often, some input variables are under the decision makers control.

• We can use simulation to assist in finding the values of the controllable variables that cause the system to operate optimally.

• The following examples illustrate this process.

Page 49: Spreadsheet Modeling & Decision Analysis

12-49

An Reservation Management Example:Piedmont Commuter Airlines

• PCA Flight 343 flies between a small regional airport and a major hub.

• The plane has 19 seats & several are often vacant.• Tickets cost $150 per seat.• There is a 0.10 probability of a sold seat being

vacant.• If PCA overbooks, it must pay an average of $325

for any passengers that get “bumped”. • Demand for seats is random, as follows:

• What is the optimal number of seats to sell?

Demand 14 15 16 17 18 19 20 21 22 23 24 25

Probability .03 .05 .07 .09 .11 .15 .18 .14 .08 .05 .03 .02

Page 50: Spreadsheet Modeling & Decision Analysis

12-50

Random Number Seeds• RNGs can be “seeded” with an initial value that

causes the same series of “random” numbers to generated repeatedly.

• This is very useful when searching for the optimal value of a controllable parameter in a simulation model (e.g., # of seats to sell).

• By using the same seed, the same exact scenarios can be used when evaluating different values for the controllable parameter.

• Differences in the simulation results then solely reflect the differences in the controllable parameter – not random variation in the scenarios used.

Page 51: Spreadsheet Modeling & Decision Analysis

12-51

Implementing & Simulating the Model

See file Fig12-19.xls

Page 52: Spreadsheet Modeling & Decision Analysis

12-52

Important Software Note•OptQuest requires at least one Assumption cell

to be defined in the workbook being optimized. • If you use Crystal Ball's built-in RNG functions to

implement your model (as done in this text) your workbook may not contain any Assumption cells.

•To circumvent this limitation of OptQuest, simply define one Assumption cell in any unused cell in your workbook.

•This Assumption cell will have no influence on the results of the model, but its presence is required for OptQuest to optimize the Decision cells in your model.

Page 53: Spreadsheet Modeling & Decision Analysis

12-53

Inventory Control Example:Millennium Computer Corporation

(MCC)• MCC is a retail computer store facing fierce competition.• Stock outs are occurring on a popular monitor.• The current reorder point (ROP) is 28.• The current order size is 50.• Daily demand and order lead times vary randomly, viz.:

Units Demanded:0 1 2 3 4 5 6 7 8 9 10Probability: 0.010.020.040.060.09 0.14 0.18 0.22 0.16 0.060.02

Lead Time (days): 3 4 5Probability: 0.2 0.6 0.2

• MCC’s owner wants to determine the ROP and order size that will provide a 98% service level while minimizing average inventory.

Page 54: Spreadsheet Modeling & Decision Analysis

12-54

Implementing & Simulating the Model

See file Fig12-27.xls

Page 55: Spreadsheet Modeling & Decision Analysis

12-55

A Project Selection Example:TRC Technologies

• TRC has $2 million to invest in the following new R&D projects.

• TRC wants to select the projects that will maximize the firm’s expected profit.

Revenue PotentialInitial Cost Prob. Of ($1,000s)

Project ($1,000s) Success Min Likely Max1 $250 0.9 $600 $750 $9002 $650 0.7 $1250 $1500 $16003 $250 0.6 $500 $600 $7504 $500 0.4 $1600 $1800 $19005 $700 0.8 $1150 $1200 $14006 $30 0.6 $150 $180 $2507 $350 0.7 $750 $900 $10008 $70 0.9 $220 $250 $320

Page 56: Spreadsheet Modeling & Decision Analysis

12-56

Implementing & Simulating the Model

See file Fig12-34.xls

Page 57: Spreadsheet Modeling & Decision Analysis

12-57

Risk Management• The solution that maximizes the

expected profit also poses a significant (10%) risk of losing money.

• Suppose TRC would prefer a solution that maximizes the chances of earning at least $1 million while incurring at most a 5% chance of losing money.

• We can use OptQuest to find such a solution...

Page 58: Spreadsheet Modeling & Decision Analysis

12-58

End of Chapter 12