Professional Documents
Culture Documents
PowerPoint Slides Prepared By: Tava Olsen Washington University in St. Louis
7-1
9-1
Simulation
Tool for modeling uncertainty Describes probabilities of outcomes of a given decision, or set of decisions Outcomes can be averaged with probabilities to find expected, or average, outcome Excel add-in: Crystal Ball
r1, r2, , rn
Controllable Input Model
Analysis
Outcome
9-4
Entering CB Assumptions
A random input cell in Crystal Ball is called an assumption cell Select Cell Define Assumption
If an error occurs enter a dummy value in the cell first CB needs to recognize the cell as a number
CB Forecasts
The output from a CB simulation is called a forecast Steps for defining:
Select a cell or a range of formula cells Select Cell Define Forecast Enter the name and units (optional) in text Click OK
When you run the simulation the forecast values will be calculated and output for each run
9-6
Select Run Run Preferences Can change number of trials One iteration: select Run Single Step Multiple iterations: select Run Run (may need to select Run Reset first)
9-7
To run:
Forecast Window
Number of trials Trials displayed
View Frequency
9-8
Then we can substitute mean value of uncertain input to calculate output E[aX+b] = aE[X] + b E[X2] (E[X]) 2
9 - 10
Steps in Simulation
Select uncertain parameters
Each requires own probability distribution Tornado charts can help select random input parameters Data analysis and judgment
What do we want to analyze? How many trials?
9 - 11
Select output(s)
Run
Analyze output
CB Sensitivity
Found under Sensitivity Toolkit Runs entire set of simulations while varying one or two parameters Similar to Data Sensitivity except each parameter choice requires a complete set of simulation trials
9 - 12
9 - 13
9 - 14
Makes functions implicit and therefore model harder to read, debug, and understand. Useful if correlations are needed (see later) Will see list of all CB functions and associated parameters Faster than using assumption cells
9 - 15
Use trunc(CB.Uniform(min, max+1)) to get integers uniformly distributed between min and max
Assumption Cells
Can enter parameters as cell addresses
e.g., =E6 or =C7 Cell colors will be copied but distribution will not
Use Cell Copy Data and Cell Paste Data to copy and paste Only sampled when CB is run
9 - 17
Correlating Assumptions
Choose Cell Define Assumption Click on correlate
Select appropriate assumption from Select Assumption menu Enter correlation coefficient
Press Enter
9 - 18
Establish base case set of inputs Calculate base case outputs Test model and learn about range of outcomes Decide whether simulation indicated Tornado chart indicates parameters with significant impact on the outcome
9 - 19
There is a 90% probability parameter lies above this point There is a 90% probability parameter lies below this point
9 - 20
Numerical observations from experience Estimates made by experts May consist of mean, minimum, 10th or 90th percentiles Usually more readily available than empirical data
9 - 21
Judgmental data
Empirical Data
Usually not available, at least not immediately Information may be biased or otherwise inappropriate Requires judgment to determine whether best-fit distribution is appropriate Results of interest often depend on mean and variance but less on specific probability distribution Seldom sufficient due to above reasons
9 - 22
Uncertain parameter takes one of a few outcomes Entered using CB Custom distribution Outcome equally likely to fall anywhere between minimum and maximum Useful when have reasonable guess about minimum and maximum but no reason to suspect any value in between more likely than others
Uniform
9 - 23
More flexible than uniform Can have peak anywhere in its range Need minimum, maximum, and most likely values for outcomes Infinite tails negative values are possible Symmetric most likely outcome is midpoint Appropriate for representing uncertain quantities influenced by a large number of independent factors
9 - 24
Normal distribution
Normal Distribution
9 - 27
Sources of Error
Model error
Model is abstraction of reality Caused by fact simulation is an experiment Usually a lesser problem than model error but should not be ignored Should be measured and controlled
9 - 28
Simulation error
Simulation Error
Small samples lead to large errors Even 1000 trials usually not sufficient for great accuracy Get closer to right answer as number of trials increases Mean Standard Error (MSE) measures precision
A 95% confidence interval for true mean extends to 1.96 MSEs on either side of the sample average
9 - 29
Precision Control in CB
Many times want to run simulation to some desired level of precision
Can do this with the Precision Control feature in CB CB will run as many trials as is needed to reach desired level of precision Must specify precision in:
9 - 31
9 - 32
9 - 34
Probabilities of an Event
In many cases we want to calculate the probability of an event
=IF(Profit<30,000,1,0) By defining this cell as a forecast, the average over n trials will be an estimate of the probability of the event The MSE shows accuracy of estimate
9 - 35
Remember that ultimate goal is a good decision not highly precise simulation results
9 - 36
9 - 37
9 - 38
Certainty Sliders
Most useful
Cell represents the forecast cell Stat represents the statistic calculated Statistics are in the same order as the statistics are output in the statistics table stat 1 = number of trials, stat 2 = mean, stat 13 = MSE
CB.GetForePercentFN(cell, percent) returns the percentile value of the given forecast cell
9 - 42
Percentiles View
***insert Figure 9.38
9 - 43
Interpreting Simulations
Take care in defining outcome variables
Ensure estimates sufficiently precise to support meaningful interpretation Observe both expected outcomes and variability in outcomes
9 - 44
Optimization in Simulation
Approaches of Chapter 8 assume a deterministic model
Cannot be used when randomness in model Grid search Replicating the model CB Sensitivity OptQuest add-in
9 - 45
Grid Search
Select a series of values to test for a decision variable Run the simulation at each value Can refine grid with smaller step size after initial runs
9 - 46
Cuts down on simulation run time Removes one source of variability in differences between outcomes for different decision variables
Trend Chart
Run Open Trend Chart Choose Forecasts
Select outputs to plot Forecast Axis Vertical usually preferred Value Axis Zero Based usually preferred Choose certainty bands to plot
9 - 48
Chart Preferences
CB Sensitivity
Select the forecast values and statistics of interest Select the decision variables to vary (up to two) Select the range of values for the decision variables Run then view values that are best choices for the forecasts of interest May refine range of values to test and rerun
9 - 49
OptQuest Add-in
Maximizes (or minimizes) an objective function by changing the values of decision variables possibly subject to one or more constraints
Use when objective depends on simulation outcomes Objective can be any summary measure of a forecast cell
9 - 50
Decision Variables
Highlight cell then Define Decision Variable Lower and upper limits defined
Discrete
Continuous
9 - 51
Imposed afterwards
9 - 52
Define decision variables, specify lower and upper bounds for the searching process Make sure at least one explicit assumption cell is defined through distribution gallery
9 - 53
3. In OptQuest
a. Tools Decision variables: specify LB and UB for the searching process
9 - 54
Select objective
9 - 55
9 - 56
5. In Excel, test the OptQuest result with more iterations Run Run Preferences
9 - 57
OptQuest Solutions
Heuristic approach
Extra care must be taken to ensure solution sensible Task complicated by the fact that the results of each set of trials is an estimate
Even if one combination of decision variables dominates another combination over one set of trials the second may actually be the better combination
9 - 58
An initial population of starting values for the decision variables are randomly sampled and then simulated The initial population are combined in such a way that solutions already sampled are not resampled and the population of alternatives remains diverse A predictive model is derived based on past solutions and then used to filter out candidates that are likely to be poor (and therefore need not be simulated) 9 - 59
Tabu search
Neural networks
OptQuest Notes
Keep the simulation run length relatively short
Consult the performance graph to see if it seems to have converged Use OptQuest Solution Analysis Experiment with different values of decision variables before running model
9 - 60
A cell to the side that generates a Uniform(0,1) random variable will do the trick
If no such cell is defined then OptQuest will assume the model is deterministic and only run one replication for each value of the decision variables
9 - 62
Coordinate with CB
9 - 64
Should have significant impact on outcome Uniform, triangular, normal, and custom most used Choose suitable simulation run lengths
Summary
Simulation answers: What are the risks? CB convenient tool within Excel Appropriate sensitivity analysis should always be carried out on deterministic version of the model before simulating Optimizing within simulation not routine but number of approaches available