0% found this document useful (0 votes)
22 views40 pages

Cristal

Chapter 12 introduces simulation using Crystal Ball, emphasizing its importance in analyzing models with uncertain variables. It discusses various methods of risk analysis, including best-case/worst-case and what-if analysis, highlighting the advantages of simulation for unbiased scenario generation. The chapter also outlines the process of implementing simulation in spreadsheet models and the use of random number generators to assess risk effectively.

Uploaded by

aldo.henrique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views40 pages

Cristal

Chapter 12 introduces simulation using Crystal Ball, emphasizing its importance in analyzing models with uncertain variables. It discusses various methods of risk analysis, including best-case/worst-case and what-if analysis, highlighting the advantages of simulation for unbiased scenario generation. The chapter also outlines the process of implementing simulation in spreadsheet models and the use of random number generators to assess risk effectively.

Uploaded by

aldo.henrique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 40

Chapter 12

Introduction to Simulation
Using Crystal Ball

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

12-2
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.
12-3
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.

12-4
Methods of Risk Analysis

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

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

12-6
Possible Performance Measure
Distributions Within a Range

worst case best case worst case best case

worst case best case worst case best case


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

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

12-9
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.
12-10
Implementing the Model

See file Fig12-2.xls

12-11
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?

12-12
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 Random Number
Generators (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.

12-13
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. Please install it
by clicking on the installation program called
Crystal Ball 7 (under the folder Crystal Ball 7.2.1).
• 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 12-14
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.

12-15
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)

12-16
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 1
1.0 to 1.999 2
2.0 to 2.999 3
3.0 to 3.999 4
4.0 to 4.999 5
5.0 to 5.999 6
12-17
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 car can
be any value between 0 and the maximum
capacity of the fuel tank.

12-18
Some of the RNGs Provided by Crystal
Distribution Range Ball
Usage
Function
Binomial CB.Binomial(p,n) Discrete. Describes the number of successes in
a fixed number of trials, such as the number of
heads in 10 flips of a coin or the number of
defective parts among 50 items.
Custom CB.Custom(range) Discrete or Continuous. User-defined
distribution.
Poisson CB.Poisson(l) Discrete. Describes the number of times an
event occurs in a given interval, such as the
number of telephone calls per minute.
Continuous CB.Uniform(min,max) All values between the min and the max are
Uniform equally likely to happen.
Exponential CB.Exponential(l) Continuous. Describes the amount of time that
passes between events, such as the time
between failures of electronic equipment or the
time between arrivals at a service booth.
Normal CB.Normal(m,s,min, Continuous. Used to to model many
max) phenomenon that varies in a symmetric fashion
around a mean such people’s IQ.
Triangular CB.Triang(min, Continuous. Describes the behavior of a random
most likely, max) number when you we know are the minimum,
maximum, and most likely values (example 12-19
number of units we expect to sell for a new
car).
Examples of Discrete Probability
Distributions
CB.Binomial(0.2,10) CB.Binomial(0.5,10) CB.Binomial(0.8,10)
0.40 0.40 0.40
0.30 0.30 0.30
0.20 0.20 0.20
0.10 0.10 0.10
0.00 0.00 0.00
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

CB.Custom(range) INT(CB.Uniform(20,24))
0.50 0.50
0.40 0.40
0.30 0.30
0.20 0.20
0.10 0.10
0.00 0.00
20 21 22 23 20 21 22 23

CB.Poisson(0.9) CB.Poisson(2) CB.Poisson(8)


0.40 0.40 0.40
0.30 0.30 0.30
0.20 0.20 0.20
0.10 0.10 0.10
0.00 0.00 0.00
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 2 4 6 8 10 12 14 16 18 20
12-20
Examples of Continuous Probability
Distributions
CB.Normal(20,1.5) CB.Normal(20,3) CB.Normal(20,3,15,23)
0.30 0.30 0.30
0.25 0.25 0.25
0.20 0.20 0.20
0.15 0.15 0.15
0.10 0.10 0.10
0.05 0.05 0.05
0.00 0.00 0.00
12 14 16 18 20 22 24 26 28 12 14 16 18 20 22 24 26 28 11 13 15 17 19 21 23 25 27 29

CB.Gamma(0,1,2) CB.Gamma(0,5,2) CB.Exponential(5)


0.50 0.50 0.50
0.40 0.40 0.40
0.30 0.30 0.30
0.20 0.20 0.20
0.10 0.10 0.10
0.00 0.00 0.00
0 2 4 6 8 10 12 0 2 4 6 8 10 12 14 16 18 0 2 4 6 8 10

CB.Triangular(3,4,8) CB.Triangular(3,7,8) CB.Uniform(40,60)


0.50 0.50 0.15
0.40 0.40
0.30 0.30 0.10
0.20 0.20 0.05
0.10 0.10
0.00 0.00 0.00
2.5 3.5 4.5 5.5 6.5 7.5 8.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 30.0 40.0 50.0 60.0 70.0
12-21
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.

12-22
Revising & Simulating the Model

See file Fig12-9.xls

12-23
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...
12-24
Constructing a Confidence Interval
for the True Population Mean
s
95% Lower Confidence Limit = y-1.96 
n
s
95% Upper Confidence Limit = y  1.96 
n

where:
y  the sample mean
s = the sample standard deviation
n = the sample size (and n 30)

Note that as n increases, the width


of the confidence interval
decreases. 12-25
Constructing a Confidence Interval
for the True Population Proportion
p (1  p )
95% Lower Confidence Limit = p-1.96 
n

p (1  p )
95% Upper Confidence Limit = p  1.96 
n
where:
p the proportion of the sample that is less than some value Yp
n = the sample size (and n 30)
Note again that as n increases, the
width of the confidence interval
decreases.
In general, the z-variate corresponding to (1 -
) % confidence level, is give by NORMSINV(1-
/2) 12-26
Number of Iterations Required
• From Central Limit Theory, 95% confidence interval is:

X 1.96 s / n

• If L= 2 *1.96 s / n is considered too large, more


replications are necessary:
(2 *1.96) 2 * (estimated standard deviation) 2
n
L2
• In the Figure 12-9 example, suppose with 1000
replications we
L 2 *1.96 *1got
,195,766 / 1000 
$148,229. In other words, we have 95% confidence
that the true mean cost is within L/2 or $74,114 from
the sample mean of $31,578,945. If we want L to be
$50,000 with 95% confidence, how many replications
are necessary?(2 *1.96) 2 * (1,195,766) 2
• Answer: n 8,800
2
(50,000)
12-27
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.

12-28
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:
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

• What is the optimal number of seats to sell?


12-29
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.
12-30
Implementing & Simulating the
Model
See file Fig12-20.xls

12-31
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 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.
12-32
Inventory Control Example:
Millennium Computer Corporation
(MCC)
• MCC is a retail computer store facing fierce competition.
• Stockouts 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 10
Probability: 0.010.020.040.060.09 0.14 0.18 0.22 0.16 0.060.02

Lead Time (days): 3 4 5


Probability: 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. 12-33
Implementing & Simulating the
Model
See file Fig12-30.xls

12-34
A Project Selection Example:
TRC Technologies
• TRC has $2 million to invest in the following new R&D
projects. Revenue Potential
Initial Cost Prob. Of ($1,000s)
Project ($1,000s) Success Min Likely Max
1 $250 0.9 $600 $750 $900
2 $650 0.7 $1250 $1500 $1600
3 $250 0.6 $500 $600 $750
4 $500 0.4 $1600 $1800 $1900
5 $700 0.8 $1150 $1200 $1400
6 $30 0.6 $150 $180 $250
7 $350 0.7 $750 $900 $1000
8 $70 0.9 $220 $250 $320
• TRC wants to select the projects that will maximize
the firm’s expected profit. 12-35
Implementing & Simulating the
Model
See file Fig12-40.xls

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

12-37
Construction of General Efficient
Frontiers Using Crystal Ball
• In Chapter 8, we discussed construction of
efficient frontier for a portfolio of stocks based
on their historical performance.
• Crystal Ball can be used to construct an
efficient frontier when distributions are
assumed for the returns of the various
investments, in the presence of correlations
between the returns.
• This is illustrated with an example.

12-38
McDaniel’s Group Investment in Power Generation
Assets

Generation Capacity per Million $ Invested


Fuel Type Gas Coal Oil Nuclear Wind
MWs 2.0 1.2 3.5 1.0 0.5

Normal Distribution Return Parameters by Fuel Type


Gas Coal Oil Nuclear Wind
Mean 16% 12% 10% 9% 8%
Std Dev 12% 6% 4% 3% 1%

Correlations Between Returns by Fuel Type


Gas Coal Oil Nuclear Wind
Gas 1 -0.49 -0.31 0.16 0.12
Coal 1 -0.41 0.11 0.07
Oil 1 0.13 0.09
Nuclear 1 0.04
Wind 1
12-39
Implementing & Simulating the
Model
See file Fig12-49.xls

12-40

You might also like