17
12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

Embed Size (px)

Citation preview

Page 1: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-1

Introduction to Spreadsheet Simulation

Using Crystal Ball

Page 2: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-2

On Uncertainty and Decision-Making…

"Uncertainty is the most difficult thing about decision-making. In the face of uncertainty, some people react with paralysis, or they do exhaustive research to avoid making a decision. The best decision-making happens when the mental environment is focused. …That fined-tuned focus doesn’t leave room for fears and doubts to enter. Doubts knock at the door of our consciousness, but you don't have to have them in for tea and crumpets."

-- Timothy Gallwey, author of The Inner Game of Tennis and The Inner Game of Work.

Page 3: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

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 incorporate such

uncertainties into decision models.• Example 1: Carrier Pricing (uncertain fuel

cost)• Example 2: ROP and OQ for inventory

management (uncertain customer demand)

Page 4: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

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 fuel– future interest rates– Expected transit time (cycle time) for

replenishment– expected product demand

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

• “Risk” implies the potential for loss.

Page 5: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-5

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 $95,000 investment in inventory is expected to return $100,000 (incremental profit) in two years. Would you like to see...– the outcomes range from $90,000 to $110,000?– the outcomes range from -$30,000 to $170,000?

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

Page 6: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-6

Methods of Risk Analysis

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

Page 7: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-7

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 statistical confidence.

Page 8: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-8

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 9: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-9

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 as a function of decision variables.

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

Page 10: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-10

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 11: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-11

What is Crystal Ball?

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

• 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 12: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-12

Random Number Generators (RNGs)

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

Page 13: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-13

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 14: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-14

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 15: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-15

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 16: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-16

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 17: 12-1 Introduction to Spreadsheet Simulation Using Crystal Ball

12-17

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...