Transcript Chapter 18

A PowerPoint Presentation Package to Accompany
Applied Statistics in Business &
Economics, 4th edition
David P. Doane and Lori E. Seward
Prepared by Lloyd R. Jaisingh
McGraw-Hill/Irwin
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 18
Simulation
Chapter Contents
18.1
18.2
18.3
18.4
18.5
What is Simulation?
Monte Carlo Simulation
Random Number Generation
Excel Add-Ins
Dynamic Simulations
18-2
Chapter 18
Simulation
Chapter Learning Objectives (LO’s)
LO18-1:
LO18-2:
LO18-3:
LO18-4:
LO18-5:
LO18-6:
LO18-7:
List characteristics of situations where simulation is appropriate.
Distinguish between stochastic and deterministic variables.
Explain how Monte Carlo simulation is used and why it is called static.
Explain how to generate random data by using a discrete or continuous CDF.
Use Excel to generate random data for several common distributions.
Describe functions and features of commercial modeling tools for Excel.
Explain the main reasons for using dynamic simulation and queuing models.
18-3
Chapter 18
LO18-1 18.1 What is Simulation?
•
•
•
•
A simulation is a computer model that attempts to imitate the behavior of a real
system or activity.
Models are simplifications that try to include the essentials while omitting
unimportant details.
Simulations helps to quantify relationships among variables that are too 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.
LO18-1: List characteristics of situations where simulation is
appropriate.
•
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
18-4
Chapter 18
LO18-2 18.1 What is Simulation?
LO18-2: Distinguish between stochastic and deterministic variables.
Components of a Simulation Model
•
•
•
•
•
Deterministic variables are nonrandom and fixed.
Stochastic variables are random. The distribution must be hypothesized.
There are two broad areas of simulation: dynamic and static.
In dynamic simulation models, events occur sequentially over time. Specialized
software is required.
In static simulation models time is not explicit and the analysis can be done in
Excel spreadsheets.
18-5
Chapter 18
LO18-2 18.1 What is Simulation?
Components of a Simulation Model
Table 18.1
18-6
Chapter 18
LO18-2 18.1 What is Simulation?
Components of a Simulation Model
Table 18.1
18-7
Chapter 18
LO18-3 18.2 Monte Carlo Simulation
LO18-3: Explain how Monte Carlo simulation is used and why it is
called static.
•
•
•
•
•
•
•
The Monte Carlo method is used for static simulation.
The computer creates the values of the stochastic random variables.
The distribution and its parameters are specified.
Samples are repeatedly drawn from each distribution.
Each sample yields one possible outcome for each stochastic variable.
For each output variable, look at percentiles as well as the mean.
For each input variable, look at a histogram to verify that we are sampling from
the desired distribution.
Which Distribution?
•
Any distribution can be used for a stochastic input variable. For example:
normal, triangular, uniform, exponential etc.
18-8
Chapter 18
LO18-5 18.3 Random Number Generation
LO18-5: Use Excel to generate random data for several common
distributions.
Creating Random Data in Excel
18-9
Chapter 18
18.3 Random Number Generation
Other Ways to Get Random Data
• (Also With EXCEL): Tools > Data Analysis > Random Number Generation
• (With MegaStat): MegaStat > Random Numbers
• (With MINITAB): Calc > Random Data
• For general Monte Carlo simulation, it is best to use a specialized package such as
@Risk or Crystal Ball that offers many built-in
functions to create random data and keep track of your simulation results.
Bootstrap Method
•
•
•
•
The bootstrap method resample to estimate unknown parameters.
This method can be applied to just about any parameter.
It requires specialized software.
Bootstrap principle: The sample reflects everything we know about the
population.
18-10
Chapter 18
18.3 Random Number Generation
Bootstrap Method
•
•
•
•
•
•
•
•
•
From a sample of n observations, use Monte Carlo random integers to take
repeated samples of n items with replacement from the sample.
Calculate the statistic of interest for each sample.
The average of these statistics is the bootstrap estimator.
The standard deviation from these estimates is the bootstrap standard error.
The distribution of these repeated estimates is the bootstrap distribution.
The percentiles of the resulting distribution of sample estimator provide the
bootstrap confidence interval.
The accuracy of the bootstrap estimator increases with the number of resample.
The bootstrap method is an excellent choice when data are badly skewed.
There are bootstrap estimators for most common statistics.
18-11
Chapter 18
LO18-6 18.4 Excel Add-Ins
LO18-6: Describe functions and features of commercial modeling
tools for Excel.
•
•
Random data can be generated by using Excel, however, Excel does
not keep track of your results.
Excel add-ins offer more features such as calculating probabilities and
permitting Monte Carlo simulation.
Using @Risk Add-In
•
•
Intuitive and easy to use, @Risk input functions can be pasted
directly into cells in and Excel spreadsheet.
The input cell becomes active and will change each time you
update the spreadsheet by pressing F9.
18-12
Chapter 18
LO18-6 18.4 Excel Add-Ins
18-13
Chapter 18
LO18-7
18.5 Dynamic Simulation
LO18-7: Explain the main reasons for using dynamic simulation and
queuing models.
Discrete Event Simulation
•
•
•
•
In a dynamic simulation, stochastic variables may be discrete (measured only at
regular time intervals) or continuous (changing smoothly over time).
Discrete event simulation assesses the system state by a clock at distinct points in
time.
A snapshot of the system state at any given moment is observed.
The emphasis in discrete event simulation is on measurements such as
- Arrival rates
- Service rates
- Length of queues
- Waiting time
- Capacity utilization
- System throughput
18-14
Chapter 18
18.5 Dynamic Simulation
LO18-7
Queuing
•
•
•
•
•
Queuing theory is the study of waiting lines (the length of customer queues, mean
waiting times, facility utilization, etc.).
In a single-server facility, customers form a single, well-disciplined queue (firstcome, first-served).
The arrivals are from an infinite source and are Poisson distributed with mean
(customer arrivals per unit of time).
The service times are exponentially distributed with mean 1/ (customers served
per unit of time).
Assuming that  <  then the following may be demonstrated
18-15
Chapter 18
LO18-7 18.5 Dynamic Simulation
Queuing Models
Figure 18.15
18-16