You are on page 1of 21

ASST 8588 (Decision Making Under Risk) Topic 3a : Montecarlo Simulation (1)

How does Montecarlo Simulation work?


It relies on the use of probability distributions of input variables to represent their uncertainty
Recalculates a deterministic model many times, combining the input variables for each iteration by means of random sampling Results for key nominated variables (analytical concerns) are recorded for each pass and reported as an output probability distribution

What is Montecarlo Simulation?

A methodology that relies on repeated random sampling and statistical analysis to compute its results

Montecarlo Simulation Steps


1.- STATIC MODEL (DETERMINISTIC) Represents the logic of the case that is being modelled 2.- INPUT DISTRIBUTIONS Representation of uncertainty on input data

3.- RANDOM VARIABLE GENERATION Random sampling of each uncertain input variable
4.- OUTPUT GENERATION, ANALYSIS AND SELECTION

Gathering/storing of results data (histogram) , analysis and insights

Deterministic Model Flow


Single Pass
Variable A

Output D
Model Output E

Variable B Variable C

Montecarlo Model Flow


Multi Pass

Variable A Variable B Variable C Model

Output D Output E

Types of Distributions
Some of the usual distributions we will encounter during our work as expert simulation practitioners

Benefits of Montecarlo over Other Techniques


No meaningful increase in model logic complexity although complex mathematics can be accommodated if required The computer does all the work in calculating output distributions Montecarlo method is now widely used and understood in the industry, therefore its results accepted with ease It is easy to perform changes to the calculation models

Correlation and interdependency between variables can be implemented


A wide variety of professional and public domain software is available for users at all levels

What is Random Sampling?


It is the random selection of hundreds or thousands of values from a distributed sample of those values The sampling is performed in such a manner that when performed a large enough number of times, reproduces the original distributions shape

The distribution of the values calculated therefore reflects the probability of the values that could occur

Random Sampling
Random Sampling is the process of selecting a value from a large population in a random manner The idea is to use the samples as true representation of the larger population from where they have been taken A random number is generated and used as an entry point on the Cumulative Probability axis

A corresponding value is then read off the X axis


The random number is here represented by a uniform 0 to 1 distribution

Adapted from Samik Raychaudhuri (Oracle Crystal Ball)

Sampling With Clustering


Sampling with clustering is a simple random sampling process which consists of sampling from groups or clusters of elements
Used when it is difficult or costly to generate a complete list of population members or population is dispersed geographically

Stratified Sampling
A stratified random sample is obtained by separating the population into mutually exclusive sets or segments and then drawing simple random samples from each strata Latin Hypercube is one of the most widely used forms of stratified random sampling

Benefits of Stratified Random Sampling


The key benefits of stratified random sampling are Can provide greater precision than a simple random sample of the same size Saves computer time and cost as it requires a smaller sample for the same level of precision A stratified random sampling choice can ensure that a representative sample of the whole spectrum is obtained Can ensure that enough sample points are obtained to support a separate analysis of any sub group

The most well known strata sampling method is the Latin Hypercube, used by @Risk and most of similar software

Continuous Random Variable and Histograms


A random variable is a function X that assigns to each possible outcome in an experiment a real number
If X may assume any value in some given interval, it is called a continuous random variable If it can assume only a number of separated values, it is called a discrete random variable

If X is a random variable, we are usually interested in the probability that X takes on a value in a certain range
We can use a bar chart, called a (probability distribution) histogram, to display the probabilities that X lies in selected ranges

The table tells us that, for instance,

Continuous Random Variable Example


The following data is taken from a survey is a European country

Frequency Table (1,000s)


Age
Number of Tertiary Students

15-19 2.7

20-24 4.8

25-29 1.9

30-34 1.2

>=35 TOTAL 1.8 12.4

Probability Table
Age Probab of Tertiary Students 15-19 .22 20-24 .39 25-29 .15 30-34 .10 >=35 TOTAL .15 1.00

Continuous Random Variable Example


The histogram for the sample is simply the bar graph of the probability distribution table
Students
0.50 0.40 0.30 0.20 0.10 0.00 15-19 20-24 25-29 30-34 >35

we can easily answer

questions such as

- What is the probability of a student being age 20 or older? (78%) - What is the probability of a student being 25 to 29? (15%)

Continuous Random Variable Example


From the histogram we can easily answer some questions
Students
0.50

But other questions can not easily be answered, such as

0.40 0.30 0.20 0.10 0.00 15-19 20-24 25-29 30-34 >35

- What is the probability of a student being age 22 or older? (?%)

Continuous Random Variable Example


The histogram as plotted did allow some partial answers to selected questions only We needed a smoother type of histogram It could have been achieved by selected finer ranges, for instance the range could have been divided in steps of 1 year instead, this would have created a smoother graph, albeit lower in height Nevertheless, it still would have not easily answered questions such as What is the probability of a student being 20 years or older? The above leads to the need for using continuous distribution graphs and calculating probabilities by estimating the area under the curve

We know that a Relative Frequency Diagram is simply a histogram of actual observations for any given experiment
The number of total observations is represented by the sum of all observations in each of the histogram segments The histograms can be used to generate probability density distributions i.e. area under the curve is 1.0 or 100%

Discrete and Continuous Distributions

Theory of statistical probability for continuous random variable is based on continuous probability density distributions
We know that smoother histograms can be generated by finer definition of the ranges Sometimes Continuous Probability Distributions are defined as functions f(x)

Recommended Reading
1.- Decision Analysis for Petroleum Exploration
Paul D. Newendorp PennWell Books

End of Topic 3a

You might also like