Transcript simulation

Introduction to
Simulation
What is simulation?
A simulation is the imitation of the operation
of a real-world system over time.
 It involves the generation of an artificial
history of a system.
 The observations of the artificial history are
used to draw inferences about the operating
characteristics of the system.

Simulation Models
A simulation model consists of a set of
assumptions that describe the operation of a
system.
 These assumptions are expressed in
mathematical, logical, and symbolic
relationships between the entities of the
system.

Simulation Models

The simulation model, once developed and
validated, can be used to investigate a wide
variety of “what-if” questions about the realworld system.
Monte Carlo
Simulation
A Manual Algorithm
1. Calculate the relative frequency of
occurrence of each possible outcome

relative frequency = number of times x occurs /
total number of observations = Pr(outcome = x)
Spare Parts Example
Number of
Failures
0
1
2
3
4
Number of
Occurences
3
7
5
10
5
30
Relative
Frequency
3/30=.1
7/30=.233
5/30=.167
10/30=.333
5/30=.167
A Manual Algorithm
2. Calculate the cumulative distribution of the
possible outcomes - Pr(outcome <= x)
Spare Parts Example
Number of
Failures
0
Relative
Frequency
.1
Cummulative
Distribution
Pr(x<=0)=.1
1
.233
P(x<=1)=.333
2
.167
Pr((x<=2)=.5
3
.333
P(x<=3)=.833
4
.167
Pr(x<=4)=1
A Manual Algorithm
3.Use random numbers to simulate the possible
outcomes by associating these numbers with
the intervals of the cumulative distribution.
 random
numbers = a set of numbers, each of which
has the same probability of occurring
Spare Parts Example
Number of
Failures
0
Cummulative
Distribution
.1
Random
Numbers
000-100
1
.333
101-333
2
.5
334-500
3
.833
501-833
4
1.0
834-999
A Manual Algorithm
4.Repeat step 3 a suitable number of times to
generate the desired statistics.
Spare Parts Example
Number of
Failures
0
Random
Numbers
000-100
Tablulated Simulated
RNs
Outcomes
632
3
1
101-333
885
4
2
334-500
559
3
3
501-833
462
2
4
834-999
553
3
Simulation with
Spreadsheets
Random Variable Generation
RAND() - this function returns a uniformly
distributed random number between 0.0 and
1.0.
 NORMINV(RAND,) - this function returns
a normally distributed random variable with
mean= and standard deviation =
 Some other distributions can be generated by
formula.

Empirical Distributions

Empirical distributions are distributions based
on observed historical data that are not fit to
any specific probability distribution.
 Embedded

IF(logical_test,value_if_true,value_if_false)
 Table

ifs
lookups
VLOOKUP
Replicating the Model
Data Tables
 To set up a two-input data table

 In
a cell, enter the formula that will use the
substituted values.
 Starting in the cell below the formula, enter the
values that you want substituted into one input
cell. Enter these values in the same column as the
formula.
Replicating the Model
 Starting
in the cell to the right of the formula, enter
the values that you want substituted into the other
input cell. Enter these values in the same row as
the formula.
Data Analysis
Descriptive Statistics
 Histogram
 Anova
 Etc.
