Documentos de Académico
Documentos de Profesional
Documentos de Cultura
4
Some SA Techniques
Scenarios – base, pessimistic, optimistic
How did we do with “scenario planning”?
1-way and 2-way data tables and associated graphs
as in the Break Even spreadsheet
Tornado diagrams
a one variable at a time technique
Top Rank –Excel add-in for simple “What if?”
Risk Analysis or Spreadsheet Simulation
direct modeling of uncertainty through probability distributions
@Risk , CrystalBall – sophisticated Excel add-ins
5
Tornado Diagrams
7
Sensitivity Analysis with TopRank
8
Preview of Monte-Carlo Simulation
Simple Excel Simulation example
Revenue for 3 products with fixed prices and
random demands
What is simulation
When do you use simulation
Real applications of simulation
Prob distributions – the building blocks of
simulation
9
Monte-Carlo Simulation
A modeling approach that allows explicit incorporation of uncertainty
in spreadsheet models
Got its start during the Manhattan project in WWII for modeling
nuclear devices
One or more random elements modeled with probability distributions
Sample from the input distributions many, many times
Keep track of the values of the outputs for each sampling of the inputs
Analyze the outputs
Often called Risk Analysis
Uncertainty is about values of unknown variables
Risk is about consequences of uncertainty
@RISK - Palisade Software
Spreadsheets provide good environment for simulation
Goes beyond expected values and point estimates
Doing simulation involves more than just building models with
software
must be probability/stats literate to do proper input and output analysis
Our First Simple Simulation Model
3ProductSimulation-template.xls
Three Product Revenue Simulation Model
Total
12
Building a Spreadsheet Based Simulation Model
(1) Build
deterministic Inputs Formulas Outputs
model
Deterministic Inputs
(2) Choose
inputs to model Inputs
as random Stochastic or Uncertain or Random Inputs
0.35
0.30
0.25
Probability
0.20
0.15
0.10
0.05
0.00
100 150 200 250 300
Demand
Many more…
Building a Spreadsheet Based Simulation Model
“Running the model”
(4.1) “Manually”, through formulas and
(4) Recalculate either many rows or VBA (Ex 11.1)
spreadsheet many times 2 options
(4.2) Use spreadsheet simulation add-in
@Risk such as @Risk or Crystal Ball (Ex 11.2)
www.palisade.com Crystal Ball
www.decisioneering.com
Probability: The Language of Uncertainty
Distributions: Building Blocks of Simulation
Random variables
Discrete probability distributions
Expected value of a discrete random
variable
Continuous probability distributions
Using Excel’s probability and statistics
functions
Using the RiskView add-in
You learned about most of the above and more in your
Statistics course. I’ll just do a quick refresher as needed on
some concepts we’ll need for this course.
Random variables (RV) and
probability distributions
RV is a variable whose value depends on the outcome of an uncertain
event(s)
Low bid by competing firms, project completion date
Demand for some product or service next year
Number of patients requiring open heart surgery next month at Hospital H
Cost of Drug X in December, 2004
Probability of various outcomes determined by probability distribution
associated with the RV
Probability distributions are the “shapes of RV’s”
As modelers, we select appropriate distributions
Probability distributions
mathematical functions
Assign numeric probabilities to uncertain events modeled by the
distribution
See “Distributions, Simulation and Excel Functions” handout that Prof. Doane
created and that I’ve posted on Web.
Using Distributions for
Simulation
We will model uncertain inputs with probability
distributions
Need to be able to generate random numbers from various
probability distributions
We may “fit” probability distributions to raw data to
serve as a convenient model of the data
Simulation model outputs will be distributions
Need to know how to compute various measures from
distributions
Simulating different scenarios - Need to know how to
compare features of distributions with each other
17
Two Types of Distributions
Discrete Distributions
• Integer, countable X
• EX: # of warranty claims in a day
• P(X) is the probability at each point
• P(X) may be summed over X values
Continuous Distributions
• X defined over an interval
• EX: Length of stay for open heart surgery patients
• Points have no area
• Calculus gives area under curve
P.D.F. vs. C.D.F
Probability Density Function
• X axis shows values of X
• Y axis shows probability
• P(X) = 1 if discrete
• f(x) = 1 if continuous
• Histogram is pdf for data
DistributionReview.xls 0.35
0.30
0.25
Probability
0.20
0.15
0.05
x Prob[X=x] Prob[X<=x]
Cumulative
Expected Value of Discrete RV
Demand Probability Probability n
100
150
0.30
0.20
0.30
0.50 E[ X ] xi P[ X xi ]
200 0.30 0.80 i 1
250 0.15 0.95
300 0.05 1.00 A few discrete distributions
172.5 1.00
Empirical
Binomial – BINOMDIST()
Poisson – POISSON()
Expected Demand Total Probability
Cumulative Distribution Function (CDF)
for a Discrete Random Variable
F ( x) Pr( X x) p( xi )
xi x
0 F ( x) 1 F(x) is nondecreasing in x
21
Distribution Review
Download DistributionReview.xls
Let’s answer questions on sheet Discrete
We’ll do Continuous sheet momentarily
Excel has many probability and statistical
related functions
Remember, probability distributions are a
type of model for some uncertain quantity
Think of histograms as empirical probability
distribution functions
Continuous RVs and Probability
Distributions
Infinite # of outcome values b
Has a probability distribution P[ X b] f ( x)dx
(density) function (pdf), f(x),
We calculate probabilities over
Area under the f(x) curve
intervals using the cumulative
from –infinity to b
distribution function (cdf), F(x),
which is P[X<=b]
E[ X ] xf ( x)dx
0 .3 0
0 .2 0
0 .1 0
Pro: Easy to un derstand.
0 .0 0 C on: N eed to create categories.
50 100 200 500 1000
Re v e n u e
The Normal Distribution
Two parameters: Mean, standard deviation
Symmetric
Standard normal distribution has mean=0, std dev=1
Normally distributed data with any mean and standard
deviation can be converted to a N(0,1) by
standardizing
X
X~N(,) Z Z~N(0,1)
Using U(0,1)’s to
generate Normal
random CDF for N(160,40)
variables
Random # =122.57
Generating Random Numbers
Excel’s Data Analysis Tool-Pak
Excel RAND() along with transformations
Not possible for all distributions
@Risk functions
@Risk has myriad of functions for generating random
numbers from a wide variety of distributions
The file ProbabilityDistributions.xls (Downloads
section of course web) illustrates generating various
random variables
www.random.org
33
Some of the broadly applicable
insights...
Explicit incorporation and quantification of risks and uncertainties is often
important
Be wary of clairvoyant analysts!
Several methods for trying to incorporate uncertainty in analysis
Quantification of risk is difficult and subject to common human decision
biases
Humans have hard time with uncertainty
It’s important to guard against decision biases
Awareness is half the battle
It’s OK to say “I DON’T KNOW”
Not all information is worth the cost or equally valid
Obtaining data for some of these modeling approaches can be difficult
probability estimation can be tough
historical data may or may not exist
What is Simulation?
• A simulation is a computer model that
attempts to imitate the behavior of a real
system or activity.
• Simulations helps to quantify relationships
among variables that are to complex to
analyze mathematically.
• If the simulation’s predictions differ from
what really happens, refine the model in a
systematic way until its predictions are in
close enough agreement with reality.
35
What is Simulation?
When Do We Simulate?
• In general, consider simulation when
- The system is complex
- Uncertainty exists in the variables
- Real experiments are impossible or costly
- The processes are repetitive
- Stakeholders can’t agree on policy
36
What is Simulation?
When Do We Simulate?
• Conversely, we are less inclined to simulate
when
- The system is simple
- Variables are stable or nonstochastic
- Real experiments are cheap and
nondisruptive
- The event will only happen once
- Stakeholders agree on policy 37
What is Simulation?
Advantages of Simulation
• In a deterministic model, variables can’t
vary.
• Simulation lets key variables change in
random but specified ways.
• Simulation helps us understand the range of
possible outcomes and their probabilities.
• Simulation allows sensitivity analysis.
38
Advantages of Simulation
• Simulation is useful because it
- Is less disruptive than real experiments
- Forces us to state our assumptions clearly
- Helps us visualize the implications of our
assumptions
- Reveals system interdependencies
- Quantifies risk by showing probabilities of events
- Helps us see a range of possible outcomes
- Promotes constructive dialogue among
stakeholders
39
Risk Assessment
• Risk assessment means thinking about a
range of outcomes and their probabilities.
• Variation is inevitable.
• Knowing the 95% range of possible values for
the decision variable as well as the “most
likely” value , is the point of risk assessment.
• Risk assessment is useful when the model is
complex.
40
What is Simulation?
Components of a Simulation Model
41
What is Simulation?
Components of a Simulation Model
42