SlideShare a Scribd company logo
TU08
Monte Carlo simulation in MS Excel
The Monte Carlo method is based on the generation of multiple trials to determine the expected value of a
random variable. The basis of the method is provided by the following relationship:
%8.99
31
Pr ≈






<−∑ NN N
σ
µξ
There are a number of commercial packages that run Monte Carlo simulation, however a basic spreadsheet
program can be used to run a simulation. In this case the generation of multiple trials is implemented by
propagating a basic formula as many times as the number of iterations required by the model.
Lets assume that a project has six activities. Each activity has a total cost in a specified range. In some cases the
value is fixed (Activity B), but generally it can assume any value within an interval. Each of these variables can
have a unique distribution, but as we will see in a moment, we can safely assume a uniform distribution without
compromising the result.
One important assumption that we make is that each of these variables is independent of the others. This means
that the cost of any activity is not influenced by the cost of any other activity.
Activity Minimum Maximum
A 10,000 20,000
B 15,000 15,000
C 7,500 12,000
D 4,800 6,200
E 20,000 25,000
F 5,000 7,000
Total 62,300 85,200
The total cost of the project is a random variable with a value between the minimum and the maximum. This
variable will be normally distributed since it is the sum of a number of random variables. This is also the reason
why the individual distribution of each variable is not important.
The general scheme of the Monte Carlo method is as follows:
Generate random values for each of the activity costs
Add each series of random values to arrive at a total project cost.
The expected project cost is the average of these values.
There are a number of parameters that can be calculated to assess the goodness of the solution. We will discuss
some of these parameters later on.
The first step is to generate random values for each of the activity costs. Assuming a uniform distribution, we can
use the RAND() function to generate random numbers in the interval (0,1) and multiply these by the range of
each variable. The range is the difference between the maximum value and the minimum value.
The random cost for Activity A will look like this:
=RAND()*(20,000-10,000)+10,000
This formula generates a random value between 10,000 and 20,000
If we create one of these formulas for each of the activities, the total project cost will be the sum of all these
functions. We can propagate the row of formulas for each iteration of the model.
The following table is a sample of the model showing the first seven iterations. Row 4 is the basic model, which
is propagated as required.
Monte Carlo simulation in MS Excel
TU08 2
A B C D E F G H
1 Activity A B C D E F Total
2 Minimum 10,000 15,000 7,500 4,800 20,000 5,000 62,300
3 Maximum 20,000 15,000 12,000 6,200 25,000 7,000 85,200
4 14,167 15,000 7,773 5,682 20,788 5,837 69,247
5 15,556 15,000 10,452 4,943 20,957 6,239 73,148
6 19,970 15,000 8,717 6,136 24,853 6,474 81,149
7 16,811 15,000 11,405 5,252 21,764 6,235 76,467
8 14,783 15,000 10,030 4,870 21,070 6,145 71,898
9 18,002 15,000 8,435 4,808 20,890 5,211 72,346
10 17,628 15,000 9,808 5,112 22,612 5,138 75,297
Determining the number of iterations
The Monte Carlo method provides an estimate of the expected value of a random variable and also predicts the
estimation error, which is proportional to the number of iterations.
The total error is given by:
N
σ
ε
3
= where b is the standard deviation of the random variable, and N is the
number of iterations. We can estimate an upper bound of b by calculating the standard deviation between the
maximum, the minimum and average values of the random variable:
σ = STDEVP(H2:H3,AVERAGE(H2:H3)) = 9,349
Note that we used the function STDEVP, which calculates the standard deviation of the entire population, in this
case only 2 values.
Lets determine the number of iterations required for an error of less than 2%. A gross estimation of the random
variable is the average of the maximum value and the minimum value. An absolute error of 2% is this average
divided by 50:
ε = AVERAGE(H2:H3)/50 = 1,475
Therefore the number of iterations to obtain a result with an error of less than 2% is:
362
475,1
349,93
2
=




 ×
=N
The Model is ran by propagating line 4 a total of 362 times. The expected value of the random variable is the
average of the Total column:
Expected project cost = AVERAGE(H4:H547) = 73,428
Given that the variable is normally distributed, the median should be very close to the mean
MEDIAN(H4:H547) = 73,304. A difference of only 0.2%
The standard deviation is calculated over the entire population:
STDEVP(H4:H547)=3,604
We can now review the true error of the estimate
3.568
362
604,333
=
×
==
N
σ
ε
This is an error of only 0.8%.
Other useful information is the Kurtosis and the Skewness of the distribution. The Kurtosis is a relative measure
of the shape compared with the shape of a normal distribution. The normal distribution has a Kurtosis of 0.
=KURT(H4:H547) = -0.296
=RAND()*(A$3-A$2)+A$2
=SUM(B4:G4)
Monte Carlo simulation in MS Excel
TU08 3
This indicates that the distribution is somewhat flatter than a normal distribution.
Skewness is a measure of asymmetry. The normal distribution has a skewness of 0.
=SKEW(H4:H547) = 0.061
This indicates that the tail of the distribution extends towards the right.
The results can be easily plotted to produce the following chart:
Frequency/Cumulative Chart
0
10
20
30
40
50
60
63,44565,73568,02570,31572,60574,89577,18579,47581,76584,055
Cost $
Frequency
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability© Rob Jeges
www.projectware.com.au
Microsoft Project (MS Project) is a trademark of the Microsoft
Corporation.

More Related Content

PPTX
Monte carlo simulation
PPT
Monte Carlo Simulation Of Heston Model In Matlab(1)
PPTX
Computing and Data Analysis for Environmental Applications
PDF
Lecture: Monte Carlo Methods
PDF
Interpolation and-its-application
PPT
Calc 4.4a
PDF
Linear Regression (Machine Learning)
PDF
10 advice for applying ml
Monte carlo simulation
Monte Carlo Simulation Of Heston Model In Matlab(1)
Computing and Data Analysis for Environmental Applications
Lecture: Monte Carlo Methods
Interpolation and-its-application
Calc 4.4a
Linear Regression (Machine Learning)
10 advice for applying ml

What's hot (20)

PDF
Regression Analysis and model comparison on the Boston Housing Data
PDF
The use of Monte Carlo simulation in quantitative risk assessment of IT projects
PDF
15 anomaly detection
PPT
Monte Carlo Simulation Methods
PPTX
Extrapolation
ODT
Probability and random processes project based learning template.pdf
PPTX
Application of interpolation in CSE
PPT
Inequalties Of Combined Functions2[1]
PDF
17 large scale machine learning
PPT
Monte Carlo Simulations
PPT
Inequalties Of Combined Functions2[1]
PDF
Regression analysis in excel
PDF
6 logistic regression classification algo
PPTX
Data Analysis Assignment Help
PDF
13 unsupervised learning clustering
PPTX
Some Engg. Applications of Matrices and Partial Derivatives
PDF
12 support vector machines
PDF
7 regularization
PDF
Building 3D Morphable Models from 2D Images
PDF
Regression Study: Boston Housing
Regression Analysis and model comparison on the Boston Housing Data
The use of Monte Carlo simulation in quantitative risk assessment of IT projects
15 anomaly detection
Monte Carlo Simulation Methods
Extrapolation
Probability and random processes project based learning template.pdf
Application of interpolation in CSE
Inequalties Of Combined Functions2[1]
17 large scale machine learning
Monte Carlo Simulations
Inequalties Of Combined Functions2[1]
Regression analysis in excel
6 logistic regression classification algo
Data Analysis Assignment Help
13 unsupervised learning clustering
Some Engg. Applications of Matrices and Partial Derivatives
12 support vector machines
7 regularization
Building 3D Morphable Models from 2D Images
Regression Study: Boston Housing
Ad

Similar to Monte carlo-simulation (20)

PPTX
regresi linear PERTEMUAN 3 (MT), English.pptx
PDF
report
PPT
Multiple Regression.ppt
PDF
Assignment #4 questions and solutions-2013
PDF
Risk-Analysis.pdf
PDF
2014-mo444-practical-assignment-04-paulo_faria
PPTX
Data analytics Lecture power point presentations
PPT
Simple lin regress_inference
DOC
Statistics project2
PDF
Optimum Algorithm for Computing the Standardized Moments Using MATLAB 7.10(R2...
PPTX
Machine learning session4(linear regression)
PDF
Monte Carlo Simulation for project estimates v1.0
PPT
Simple Linear Regression.pptSimple Linear Regression.ppt
PDF
Design and Simulation of a Modified Architecture of Carry Save Adder
PDF
Project Paper
PDF
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
PDF
PDF
Six sigma pedagogy
PPT
Forecasting (1)
DOCX
CHAPTER TENObjectiveA brief introduction of the basic concept
regresi linear PERTEMUAN 3 (MT), English.pptx
report
Multiple Regression.ppt
Assignment #4 questions and solutions-2013
Risk-Analysis.pdf
2014-mo444-practical-assignment-04-paulo_faria
Data analytics Lecture power point presentations
Simple lin regress_inference
Statistics project2
Optimum Algorithm for Computing the Standardized Moments Using MATLAB 7.10(R2...
Machine learning session4(linear regression)
Monte Carlo Simulation for project estimates v1.0
Simple Linear Regression.pptSimple Linear Regression.ppt
Design and Simulation of a Modified Architecture of Carry Save Adder
Project Paper
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
Six sigma pedagogy
Forecasting (1)
CHAPTER TENObjectiveA brief introduction of the basic concept
Ad

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Current and future trends in Computer Vision.pptx
PPT
Total quality management ppt for engineering students
PPTX
UNIT 4 Total Quality Management .pptx
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
introduction to high performance computing
PDF
PPT on Performance Review to get promotions
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
R24 SURVEYING LAB MANUAL for civil enggi
III.4.1.2_The_Space_Environment.p pdffdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Categorization of Factors Affecting Classification Algorithms Selection
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Visual Aids for Exploratory Data Analysis.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Current and future trends in Computer Vision.pptx
Total quality management ppt for engineering students
UNIT 4 Total Quality Management .pptx
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
introduction to high performance computing
PPT on Performance Review to get promotions
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF

Monte carlo-simulation

  • 1. TU08 Monte Carlo simulation in MS Excel The Monte Carlo method is based on the generation of multiple trials to determine the expected value of a random variable. The basis of the method is provided by the following relationship: %8.99 31 Pr ≈       <−∑ NN N σ µξ There are a number of commercial packages that run Monte Carlo simulation, however a basic spreadsheet program can be used to run a simulation. In this case the generation of multiple trials is implemented by propagating a basic formula as many times as the number of iterations required by the model. Lets assume that a project has six activities. Each activity has a total cost in a specified range. In some cases the value is fixed (Activity B), but generally it can assume any value within an interval. Each of these variables can have a unique distribution, but as we will see in a moment, we can safely assume a uniform distribution without compromising the result. One important assumption that we make is that each of these variables is independent of the others. This means that the cost of any activity is not influenced by the cost of any other activity. Activity Minimum Maximum A 10,000 20,000 B 15,000 15,000 C 7,500 12,000 D 4,800 6,200 E 20,000 25,000 F 5,000 7,000 Total 62,300 85,200 The total cost of the project is a random variable with a value between the minimum and the maximum. This variable will be normally distributed since it is the sum of a number of random variables. This is also the reason why the individual distribution of each variable is not important. The general scheme of the Monte Carlo method is as follows: Generate random values for each of the activity costs Add each series of random values to arrive at a total project cost. The expected project cost is the average of these values. There are a number of parameters that can be calculated to assess the goodness of the solution. We will discuss some of these parameters later on. The first step is to generate random values for each of the activity costs. Assuming a uniform distribution, we can use the RAND() function to generate random numbers in the interval (0,1) and multiply these by the range of each variable. The range is the difference between the maximum value and the minimum value. The random cost for Activity A will look like this: =RAND()*(20,000-10,000)+10,000 This formula generates a random value between 10,000 and 20,000 If we create one of these formulas for each of the activities, the total project cost will be the sum of all these functions. We can propagate the row of formulas for each iteration of the model. The following table is a sample of the model showing the first seven iterations. Row 4 is the basic model, which is propagated as required.
  • 2. Monte Carlo simulation in MS Excel TU08 2 A B C D E F G H 1 Activity A B C D E F Total 2 Minimum 10,000 15,000 7,500 4,800 20,000 5,000 62,300 3 Maximum 20,000 15,000 12,000 6,200 25,000 7,000 85,200 4 14,167 15,000 7,773 5,682 20,788 5,837 69,247 5 15,556 15,000 10,452 4,943 20,957 6,239 73,148 6 19,970 15,000 8,717 6,136 24,853 6,474 81,149 7 16,811 15,000 11,405 5,252 21,764 6,235 76,467 8 14,783 15,000 10,030 4,870 21,070 6,145 71,898 9 18,002 15,000 8,435 4,808 20,890 5,211 72,346 10 17,628 15,000 9,808 5,112 22,612 5,138 75,297 Determining the number of iterations The Monte Carlo method provides an estimate of the expected value of a random variable and also predicts the estimation error, which is proportional to the number of iterations. The total error is given by: N σ ε 3 = where b is the standard deviation of the random variable, and N is the number of iterations. We can estimate an upper bound of b by calculating the standard deviation between the maximum, the minimum and average values of the random variable: σ = STDEVP(H2:H3,AVERAGE(H2:H3)) = 9,349 Note that we used the function STDEVP, which calculates the standard deviation of the entire population, in this case only 2 values. Lets determine the number of iterations required for an error of less than 2%. A gross estimation of the random variable is the average of the maximum value and the minimum value. An absolute error of 2% is this average divided by 50: ε = AVERAGE(H2:H3)/50 = 1,475 Therefore the number of iterations to obtain a result with an error of less than 2% is: 362 475,1 349,93 2 =      × =N The Model is ran by propagating line 4 a total of 362 times. The expected value of the random variable is the average of the Total column: Expected project cost = AVERAGE(H4:H547) = 73,428 Given that the variable is normally distributed, the median should be very close to the mean MEDIAN(H4:H547) = 73,304. A difference of only 0.2% The standard deviation is calculated over the entire population: STDEVP(H4:H547)=3,604 We can now review the true error of the estimate 3.568 362 604,333 = × == N σ ε This is an error of only 0.8%. Other useful information is the Kurtosis and the Skewness of the distribution. The Kurtosis is a relative measure of the shape compared with the shape of a normal distribution. The normal distribution has a Kurtosis of 0. =KURT(H4:H547) = -0.296 =RAND()*(A$3-A$2)+A$2 =SUM(B4:G4)
  • 3. Monte Carlo simulation in MS Excel TU08 3 This indicates that the distribution is somewhat flatter than a normal distribution. Skewness is a measure of asymmetry. The normal distribution has a skewness of 0. =SKEW(H4:H547) = 0.061 This indicates that the tail of the distribution extends towards the right. The results can be easily plotted to produce the following chart: Frequency/Cumulative Chart 0 10 20 30 40 50 60 63,44565,73568,02570,31572,60574,89577,18579,47581,76584,055 Cost $ Frequency 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Probability© Rob Jeges www.projectware.com.au Microsoft Project (MS Project) is a trademark of the Microsoft Corporation.