16
Monté Carlo Simulation Understand the concept of Monté Carlo Simulation Learn how to use Monté Carlo Simulation to make good decisions Learn how to use Monté Carlo Simulation for estimating complex integrals

Monté Carlo Simulation Understand the concept of Monté Carlo Simulation Learn how to use Monté Carlo Simulation to make good decisions Learn how

Embed Size (px)

Citation preview

Page 1: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Monté Carlo Simulation

Understand the concept of Monté Carlo

Simulation

Learn how to use Monté Carlo Simulation

to make good decisions

Learn how to use Monté Carlo Simulation

for estimating complex integrals

Page 2: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

What is Monte Carlo Simulation ?

Monte Carlo methods are a widely used class of computational algorithms for simulating the behavior of various physical and mathematical systems, and for other computations.

Monte Carlo algorithm is often a numerical Monte Carlo method used to find solutions to mathematical problems (which may have many variables) that cannot easily be solved, (e.g. integral calculus, or other numerical methods)

Page 3: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

What is Monte Carlo Simulation ?

A Monte Carlo simulation is a statistical simulation technique that provides approximate solutions to problems expressed mathematically. It utilizes a sequence of random numbers to perform the simulation.

This technique can be used in different domains: complex integral computations, economics, making decisions in specific complex problems, …

Page 4: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

General Algorithm of Monte Carlo Simulation

In general, Monte Carlo Simulation is roughly composed of five steps:1. Set up probability distributions: what is the

probability distribution that will be considered in the simulation

2. Build cumulative probability distributions3. Establish an interval of random numbers for

each variable4. Generate random numbers: only accept

numbers that satisfies a given condition. 5. Simulate trials

Page 5: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Examples

Example 1 : using Monte Carlo simulation for the analysis of real systems

Example 2: using Monte Carlo simulation to evaluate an integral.

Page 6: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Example 1. HERFY Cake Shop

Page 7: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Probability of DemandProbability of Demand

(1)(1) (2)(2) (3)(3) (4)(4)

Demand Demand for Tiresfor Tires FrequencyFrequency

Probability of Probability of OccurrenceOccurrence

Cumulative Cumulative ProbabilityProbability

00 1010 10/200 = .0510/200 = .05 .05.05

11 2020 20/200 = .1020/200 = .10 .15.15

22 4040 40/200 = .2040/200 = .20 .35.35

33 6060 60/200 = .3060/200 = .30 .65.65

44 4040 40/200 = .2040/200 = .20 .85.85

55 3030 30/ 200 = .1530/ 200 = .15 1.001.00

200 days200 days 200/200 = 1.00200/200 = 1.00

Page 8: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Assignment of Random Assignment of Random NumbersNumbers

Daily Daily DemandDemand ProbabilityProbability

Cumulative Cumulative ProbabilityProbability

Interval of Interval of Random Random NumbersNumbers

00 .05.05 .05.05 01 01 throughthrough 05 05

11 .10.10 .15.15 06 06 throughthrough 15 15

22 .20.20 .35.35 16 16 throughthrough 35 35

33 .30.30 .65.65 36 36 throughthrough 65 65

44 .20.20 .85.85 66 66 throughthrough 85 85

55 .15.15 1.001.00 86 86 throughthrough 00 00

Table F.3Table F.3

Page 9: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Table of Random NumbersTable of Random Numbers

5252 5050 6060 5252 0505

3737 2727 8080 6969 3434

8282 4545 5353 3333 5555

6969 8181 6969 3232 0909

9898 6666 3737 3030 7777

9696 7474 0606 4848 0808

3333 3030 6363 8888 4545

5050 5959 5757 1414 8484

8888 6767 0202 0202 8484

9090 6060 9494 8383 7777Table F.4Table F.4

Page 10: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Simulation Example 1Simulation Example 1

Select random numbers from Table F.3

DayDayNumberNumber

RandomRandomNumberNumber

Simulated Simulated Daily DemandDaily Demand

11 5252 33

22 3737 33

33 8282 44

44 6969 44

55 9898 55

66 9696 55

77 3333 22

88 5050 33

99 8888 55

1010 9090 55

3939 TotalTotal

3.93.9 Average Average

Page 11: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Simulation Example 1Simulation Example 1DayDay

NumberNumberRandomRandomNumberNumber

Simulated Simulated Daily DemandDaily Demand

11 5252 33

22 3737 33

33 8282 44

44 6969 44

55 9898 55

66 9696 55

77 3333 22

88 5050 33

99 8888 55

1010 9090 55

3939 TotalTotal

3.93.9 Average Average

Expecteddemand

= ∑ (probability of i units) x (demand of i units)

= (.05)(0) + (.10)(1) + (.20)(2) + (.30)(3) + (.20)(4) + (.15)(5)

= 0 + .1 + .4 + .9 + .8 + .75

= 2.95 tires

5

i =1

Page 12: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Set up probability distributions

Page 13: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Step 1: Set up the probability distribution for cake sales.

Using historical data HERFY Shop determined that 5% of the time 0 cakes were demanded, 10% of the time 1 cake was demanded, etc…

P(1) = 10%

Page 14: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Step 2: Build a Cumulative Probability Distribution

15% of the time the demand was 0 or 1 cake P(0) = 5% + P(1) = 10%

Page 15: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Example 2. Computation of Integrals

Page 16: Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how

Example 2. Computation of Integrals The Monte Carlo method can be used to

numerically approximate the value of an

integral

Pick n randomly distributed points x1, x2, …, xn in the

interval [a,b]

Determine the average value of the function

Compute the approximation to the integral  

An estimate for the error is

Where    

1

1 n

ii

f f xn

b

a

f x dx b a f

b

a

f x dx

22b aError f f

n

2 2

1

1 n

ii

f f xn