7
8/21/2019 408-2012-Lec06 MCS http://slidepdf.com/reader/full/408-2012-lec06-mcs 1/7 04-2-1 Monte Carlo simulation: continuous and categorical Resampling with the bootstrap Examples MinE 408: MCS, slides adapted from Dr. Clayton Deutsch: MIN E 310: Ore Reserve Estimation Monte Carlo Simulation The Concept Monte Carlo Simulation:  – draw uniform random numbers p  [0,1]  – apply the transform x p = q(p) = F -1 (p) Bootstrap:  – interested in uncertainty of a “statistic”  – Sample n values (with replacement) and calculate statistic  – Repeat many times to construct distribution of uncertainty

408-2012-Lec06 MCS

Embed Size (px)

Citation preview

Page 1: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 1/7

04-2-1

• Monte Carlo simulation: continuous and categorical

• Resampling with the bootstrap

• Examples

MinE 408: MCS, slides adapted fromDr. Clayton Deutsch:

MIN E 310: Ore Reserve Estimation

Monte Carlo Simulation

The Concept

• Monte Carlo Simulation:

 – draw uniform random numbers p   [0,1]

 – apply the transform xp = q(p) = F-1(p)

• Bootstrap:

 – interested in uncertainty of a “statistic”

 – Sample n values (with replacement) and calculate statistic

 – Repeat many times to construct distribution of uncertainty

Page 2: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 2/7

04-2-2

Monte Carlo Simulation

• Monte Carlo Simulation / Stochastic Simulation / Random Drawingproceeds by reading quantiles from a cumulative distribution

The procedure:

• generate a random number between 0 and 1 (calculator, table,program, ...

• read the quantile associated to that random number 

For Example:Random Number Simulated Number 

0.7807

0.1562

0.6587

0.8934

28.83   ...

   F  r  e  q  u  e  n  c  y

   C  u  m  u   l  a   t   i  v  e   F  r  e  q  u  e  n  c  y

0.7807

28.83

Comments on Monte Carlo

Simulation

• Categorical variable cumulative distribution requires an ordering (that is

inconsequential since we are doing random drawing)

• Foundation of all stochastic simulation techniques

• Essential to have a representative distribution

• Random number generation:

 – No such thing as a truly random number 

 – Not an issue for petroleum or mining applications (particle physics requires

many more numbers)

 – Sophisticated algorithms exist

Page 3: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 3/7

04-2-3

 Applying MCS: Specific Steps

1) generate distributions for your input parameters –  Geostatistics

 –  Expert knowledge

 –  Past p rices/costs

 –  Incorporate uncertainty in the different parameters

 –  Incorporate the probability of certainunknowns/decisions/options/scenarios

2) Draw initial values for one realizations/simulation

 –  Use in the calculation

 –  Draw random number , p   [0,1] , from a uniform distribution

 –  Transform value using input distribu tion xp = q(p) = F-1(p)

3) Apply your transfer function

 –  In geostatistics th is is a reserve/resource calculation –  In mine planning this is a mine plan

 –  In economics this is a NPV calculation

 –  In traffic design this is the wait time for a particular route home

4) Repeat steps 2-3 ‘n’ times (where n is l arge)

The Bootstrap

• The bootstrap is a name generically applied to statistical resampling schemes

that allow uncertainty in the data to be assessed from the data themselves, in

other words, “pulling yourself up by your bootstraps”.

• Given n observations zi, i=1,…,n and a calculated statistic S, e.g., the mean ,

what is the uncertainty in S?

• The procedure:

 – Draw n values z’i, i=1,…,n from the

original data with replacement

 – Calculate the statistic S’ from the

“bootstrapped” sample

 – Repeat L times to build up a

distribution of uncertainty in S

Gonick, L., Cartoon Guide to Statist ics, Collins Reference, 1993

Page 4: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 4/7

04-2-4

Comments on the Bootstrap

• Useful technique to assess uncertainty in input statistics

• Limitations:

 – Assumes data are independent

 – When multiple factors go into the calculation (e.g., PV

uncertainty) they are all assumed independent

 – Assumes representative data

Simple Examples• Bootstrap uncertainty in the mean:

• Bootstrap uncertainty in the correlation coefficient:

Frequency

0. 1000. 2000. 3000. 4000.

0.0

0.1

0.2

0.3 Original DataNumber of Data 17

mean 1225.28std. dev. 672.14

coef. of var 0.55

maximum 3360.87upper quartile 1305.14

median 1145.50lower quartile 758.81

minimum 485.00

Frequency

0. 1000. 2000. 3000. 4000.

0.0

0.1

0.2

0.3

0.4Bootstrap Distribution of Mean

Number of Data 1000

mean 1223.46std. dev. 156.98

coef. of var 0.13

maximum 1814.71upper quartile 1320.91

median 1214.98lower quartile 1111.62

minimum 836.53

Primary/HardData

Secondary / Soft Data

0. 5000. 10000. 15000. 20000. 25000.

3.0

5.0

7.0

9.0

11.0

13.0

 = 0.54

0.25 0.35 0.45 0.55 0.65 0.75

0.00

0.02

0.04

0.06

0.08

0.10

Page 5: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 5/7

04-2-5

Review of Main Points

• Monte Carlo Simulation is at the heart of stochastic modeling.

 – Draw randomly from U(0,1)

 – Obtain quantile associated to drawn number from cdf 

• Bootstrapping is useful in assessing uncertainty in a sample

statistic, e.g. the mean, variance, calculated properties, …

NPV example

• Consider uncertainty in:

 –  Interest rate (normal distribut ion w ith m=10% std=1%

 –  Mineral commodity price (flat real $) m=50$/unit std=5$/unit

 –  Number of years of production (simil ar to uncertainty in thereserves available) m=10yrs, s td=2yrs

 –  The following are know n wi th 100% certainty:

• 100M capital cos ts

• 1M units/year 

•  All operat ing costs are factored into the mineralcommodit y price (not realistic, but the focus of th is

example is on MCS not cost estimation).

• Reclamation costs will be 20M/year for 2 years after mining

 –  WHAT IS THE NPV (DISTRIBUTION) OF THIS MINE???

• Lets do 1 (or 2) realizations by hand

• Then 100 realizations with Excel (easy with computers)

Page 6: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 6/7

04-2-6

Tornado (fishbone) chart• Set one input variable to the LOWEST value (or maybe p10)

 –  Set all other variables to the average or p50

•  Alternatively, could do ‘n’ simu lat ions wi th th is onevariable set to the p10 and then average the resul ts

 –  Obtain the low value

• Set one input variable to the HIGEST value (or maybe p90)

 –  Set all other variables to the average or p50

•  Alternatively, could do ‘n’ simu lat ions wi th th is onevariable set to the p90 and then average the resul ts

 –  Obtain the high value

• Repeat for all input variables

MCS by Hand

• Determine distributions

• Draw values from the distributions

•  Apply transfer funct ion

• Draw random number, let’s use 0.1313 for an example

• Get a chart (make sure you know what kind of table it is …there are different ones)

• Lookup the value 0.1313 in the body of the table and get -1.12

• Convert this to a non-normal distribution by Multip lying thestd and adding mean: -1.12*1.0+10=8.88

• check in Excel if you want: “ =NORMINV(0.1313,10,1)”

Page 7: 408-2012-Lec06 MCS

8/21/2019 408-2012-Lec06 MCS

http://slidepdf.com/reader/full/408-2012-lec06-mcs 7/7

04-2-7

• If you have a value >0.5, then switch the sign:

 –  Draw random number, let’s use 0.7313 for an example

 –  Get a chart (make sure you know w hat kind of t able it is …there are different ones)

 –  Lookup the value 1-0.7313=0.2687 in the body of the table andget -0.615,

 –  Have to adjust for t he sign fo r being >0.5, so we now have0.615

 –  Convert this to a non-normal distribution by multi plying thestd and adding mean: 0.615*1.0+10=10.615

 –  check in Excel if you want: “ =NORMINV(0.7313,10,1)” . Thisone is off a bit because -0.615 is not qu ite correct, you can

linearly in terpol ate between 0.61 and 0.62 on the chart if youwant more accuracy.