Risk Analysis Using Simulation
Risk Analysis Using Simulation
Page 1 of 29
Why Simulation?
When it is too costly to do physical studies on the system itself (e.g., trying
alternative layout of a factory, building new facility)
Steps in Simulation
Model development: System defination, objectives to study, decision
variables, output measures, input variables and parameters.
Data collection: Collect data from the real system, obtain probability
distributions of the input parameters by statistical analysis
Model translation: Translate the physical model into computer simulation
software.
Simulation runs & Output Data Analysis: Run the simulation upto
satisfactory level and use statistical analysis of the ouput data to estimate
the performance measures.
Page 2 of 29
@Risk
Crystal Ball
MatLab
Minitab
Excel Spreadsheet
Page 3 of 29
Excel has many other functions for statistical, financial and other
applications
Displaying Grid Lines and Row, and Column Headers for Printing
Comment Boxes
A descriptive title
Page 4 of 29
Page 5 of 29
Model description
Page 6 of 29
Each row in the results table represents one trial of the simulation.
Since selling boxes range 40-90 boxes/year, the values in Column E were
generated by rolling a die and entered into the worksheet to verify the
formulas for profit in column F.
Random Variable - A variable that may assume any value from a set of
values according to chance. Discrete random variables can assume only a
finite or countable infinite number of values (e.g., number of rainfall events
per year). A random value is continuous if its set of possible values is an
entire interval of numbers (e.g., quantity of rain in a year).
Page 7 of 29
Types of Distribution:
Page 8 of 29
Descriptive Statistics
Parameter - A value that characterizes the distribution of a random variable.
Parameters commonly characterize the location, scale, shape, or bounds of the
distribution. For example, a truncated normal probability distribution may be
defined by four parameters: arithmetic mean [location], standard deviation
[scale], and min and max [bounds]. It is important to distinguish between a
variable (e.g., ingestion rate) and a parameter (e.g., arithmetic mean ingestion
rate).
Measures of Central Tendency: Mean, Median, & Mode
Mean: The mean of a set of values is the sum of all the values in the set
divided by the total number of values in the set.
1
N
i =1
xi
Median: The median is the middle data point when the data is ordered.
The middle value (50th percentile) in the ordered sequence of measured
values. For highly skewed data sets the median can give a better
Page 9 of 29
representation than the mean of the middle of the data distribution. The
median is not as comprehensive a measure of the data set as the mean.
Mode: The most likely value or mode is the value that occurs most often
in a set of values. In a histogram and a result distribution, it is the center
value in the class or bar with the highest probability.
Measures of Variation
(x
i =1
)2
N 1
Range: The range is the absolute difference between the maximum and
minimum values in a set of values. The range is the simplest measure of
the dispersion or "risk" of a distribution
CK =
(x
i =1
)4
Skewness:
Page 10 of 29
(x
CS =
i =1
)3
r=
(x
i =1
x )( y i y )
( N 1) S x S y
Page 11 of 29
for t > 0
Where,
F (t ) = e x dx = e x = 1 e t for t > 0.
0
Mean: =
1
and
1
Variance: 2 =
Page 12 of 29
Page 13 of 29
Page 14 of 29
Page 15 of 29
Page 16 of 29
Page 17 of 29
Page 18 of 29
Page 19 of 29
Page 20 of 29
Page 21 of 29
Divide the range from 0 to 1 into intervals that correspond to the probabilities of
the discrete outcomes.
Use VLOOKUP function (look up value, table array, column index number) or
Random number generation function in excel.
Page 22 of 29
Page 23 of 29
random
number
from
the
Uniform
distribution:
u=Uniform(0,1),
2. Calculate inverse cumulative distribution function (ICDF). In Excel, the
function name to calculate the ICDF for Normal distribution NORMINV
and for LogNormal distribution is Lognormal (LOGINV). RAND function
in excel can also be used to generate random numbers from the Uniform
distribution, and apply the built-in functions to calculate the ICDF.
Example:
For example, the following formula will return the inverse CDF of the Normal
distribution with mean=1 and standard_deviation=2 evaluated at p=0.2:
=NORMINV(0.2; 1; 2)
Replacing 0.2 with RAND will yield the Normal random number generation formula:
=NORMINV(RAND(); 1; 2)
Similarly for LogNormal distribution the function is
LOGINV (probability, mean, Standard_dev)
For triangular distribution, It may need to use If function to generate random numbers
in Excel. The structure of the IF function is:
=IF(expression, what is returned if true, what is returned if false)
If function first determines which side of the distribution corresponds to the random
number and then evaluates the appropriate formula.
=IF (RAND () < (Mode Min)/(Max Min),Left formula, Right formula)
Let assume,
In a triangular distribution, if Min is a, Mode is b and Max. is c, then
Left Formula = a + RAND () * (b a ) * (c a )
Right Formula = c (1 RAND()) * (c b) * (c a )
a xb
bxc
Page 24 of 29
Monte-Carlo Simulation
ii.
iii.
Use the generated data as probable values of the parameters in the model to
produce output.
Page 25 of 29
4. Make a summary for the descriptive statistics and collect output data in a
frequency distribution or histogram for analysis.
Example: Monte-Carlo simulation on excel for Dave's Candies problem
Output
Page 26 of 29
Solution:
Step 1: Selecting distribution for model parameters
9 Table 1 is used as input for a Monte Carlo simulation
Table 1: Input data for MCS
Input Region
Parameter
Distribution
Min.
Max.
Mean/Mode
STD
2.06E-01
4.22E-02
Fish concentration(CF),
mg/kg
Normal
Uniform
2.00E-02
1.30E-01
6.50E-02
Triangle
1.50E-04
3.00E-03
3.00E-04
Triangle
4.50E+01
1.20E+02
7.00E+01
CF
IF
RfD
BM
1
2
3
4
5
6
7
8
9
10
11
12
96
97
98
99
100
0.209
0.268
0.203
0.199
0.140
0.230
0.191
0.182
0.197
0.220
0.218
0.198
0.265
0.213
0.233
0.265
0.161
0.032
0.047
0.052
0.026
0.123
0.083
0.025
0.102
0.095
0.041
0.099
0.024
0.098
0.109
0.113
0.070
0.066
5.39E-04
9.61E-04
2.35E-03
2.51E-04
3.71E-04
6.53E-04
2.77E-03
1.00E-03
1.36E-03
6.73E-04
7.61E-04
1.57E-03
2.90E-04
4.57E-04
1.55E-03
4.98E-04
6.63E-04
59.203
66.066
109.907
95.667
94.443
60.822
78.394
80.310
57.432
84.090
59.938
88.117
90.694
84.283
64.637
93.816
87.898
Page 27 of 29
Step 3: Use the generated data as probable values in the model to calculate HQ.
9 Used model to calculate the Hazard Index (HI):
HI =
CF I F
BM RfD
CF
IF
RfD
BM
HI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-
0.209
0.268
0.203
0.199
0.140
0.230
0.191
0.182
0.197
0.220
0.218
0.198
0.142
0.268
0.217
-
0.032
0.047
0.052
0.026
0.123
0.083
0.025
0.102
0.095
0.041
0.099
0.024
0.037
0.099
0.070
-
5.39E-04
9.61E-04
2.35E-03
2.51E-04
3.71E-04
6.53E-04
2.77E-03
1.00E-03
1.36E-03
6.73E-04
7.61E-04
1.57E-03
2.05E-03
1.83E-03
2.17E-03
-
59.203
66.066
109.907
95.667
94.443
60.822
78.394
80.310
57.432
84.090
59.938
88.117
64.939
87.285
76.220
-
2.12E-01
1.97E-01
4.07E-02
2.13E-01
4.92E-01
94
95
96
97
98
99
100
0.216
0.223
0.265
0.213
0.233
0.265
0.161
0.119
0.078
0.098
0.109
0.113
0.070
0.066
2.01E-03
2.68E-03
2.90E-04
4.57E-04
1.55E-03
4.98E-04
6.63E-04
69.327
74.652
90.694
84.283
64.637
93.816
87.898
4.79E-01
2.16E-02
2.32E-01
2.40E-01
1.59E-01
4.71E-01
3.48E-02
3.92E-02
1.66E-01
9.23E-02
1.85E-01
8.68E-02
9.83E-01
6.04E-01
2.63E-01
3.95E-01
1.83E-01
Page 28 of 29
Output Summary:
The frequency distribution for the output from MCS (Monte Carlo simulation) is
shown in Fig 2.
From Monte Carlo simulation, the confidence interval for 90% & 95% are
obtained [0.193, 0.251] & [0.188, 0.256] respectively.
This implies that after taking into account the uncertainties on the parameters,
one is highly confident (at a subjective level of 95%) that the true HI should lie
between 0.188 and 0.256.
Since the 95% upper confidence limit of HI is still below 1, there is high
confidence that the maximally exposed individual for this scenario is not
exposed to an unacceptable level of risk, and remediation should not be
warranted.
Page 29 of 29
Frequenc
20
15
10
5
1.
01
0.
91
0.
81
0.
71
0.
61
0.
51
0.
41
0.
31
0.
21
0.
11
0.
01
Hazard Index
References:
Hammonds, J. S. , Hoffman, F. O., and Bartell, S .M., An Introductory Guide to
Uncertainty Analysis in Environmental and Health Risk Assessment managed by
MARTIN MARIETTA ENERGY SYSTEMS, INC. for the U.S. DEPARTMENT OF
ENERGY
James R. Evans, David Louis Olson, Introduction to Simulation and Risk Analysis,
Prentice Hall PTR, Upper Saddle River, NJ, 2001
http://www.cas.lancs.ac.uk/glossary_v1.1/prob.html#pdf
http://www.ltcconline.net/greenl/courses/201/probdist/zScore.htm