Presentation is loading. Please wait.

Presentation is loading. Please wait.

MONTE CARLO SIMULATION

Similar presentations


Presentation on theme: "MONTE CARLO SIMULATION"— Presentation transcript:

1 MONTE CARLO SIMULATION
MATH 182

2

3 SIMULATION Simulation of a process – the examination of any emulating process simpler than that under consideration. Examples: System’s Simulation such as simulation of engineering systems, large organizational systems, and governmental systems Operational Gaming such as military gaming and business gaming Monte Carlo Simulation Agent-Based simulation

4 AGENT-BASED SYSTEMS Using Netlogo

5 MONTE CARLO SIMULATION
The process is similar to gambling in casinos such as using roulette wheels, dice and playing cards. Monte Carlo is a technique for selecting numbers randomly from a probability distribution (not necessarily from a standard distribution).

6 MONTE CARLO SIMULATION
The computer-generated random numbers are called pseudo- random numbers.

7 A PSEUDO-RANDOM NUMBER GENERATOR ≈FOLLOWING Uniform Distribution [0,1]
Linear Congruential Generator (LCG) Period=m–1 x0 ≠0 is the seed number Example: a=13, b=0, m=31, x0 =8 Hence, u0 =0.2581; x1 =11, u1= Minimal Standard Random Number Generator: a=75, b=0, m=231–1 (a Mersenne prime)

8 EXAMPLE 1 DEMAND RANGE OF RANDOM NUMBER Let rϵ{1,2,…,100} 10 1-20 15
21-50 20 51-100 A simple example:

9 IF(B2<=20,10,IF(B2<=50,15,20))
Example 1 Run Random Number Simulated Demand 1 83 20 2 45 15 3 48 4 14 10 5 52 6 7 67 8 42 9 81 73 11 21 12 22 13 77 Sample Formula: ROUNDUP(RAND()*100,0) IF(B2<=20,10,IF(B2<=50,15,20))

10 example 1 So the average demand is: Using simulation (15 runs): … Using expected value: 0.2*10+0.3*15+0.5*20=16.5 Notice that Monte Carlo simulation is just a statistical experiment.

11 State1 State2 State3 State4
ANOTHER EXAMPLE: State1 State2 State3 State4 RAND RAND RAND RAND RAND

12 Integration by MC Simulation
Generate n random sequence xi є [a,b], then for m clusters of runs If you want to consolidate your m clusters of runs into just one cluster.

13 RAND()*5 CLUSTER RUNS 1 RAND CLUSTER RUNS 2 CLUSTER RUNS 3 3.58 12.81 1.22 1.49 4.29 18.37 0.76 0.58 1.12 1.26 1.46 2.12 4.50 20.22 2.68 7.17 4.58 20.93 4.90 24.02 4.74 22.49 0.33 0.11 3.97 15.77 0.26 0.07 3.89 15.11 3.50 12.25 2.04 4.15 0.80 0.64 5.00 24.96 2.25 5.07 1.58 2.49 2.17 4.72 0.08 0.01 0.73 0.53 2.83 8.00 4.66 21.75 3.31 10.94 1.62 2.62 4.54 20.63 2.64 6.95 Ave SUM(B2:B11)/10*5 62.98 42.04 39.09 48.04

14 Integration by MC Simulation
Generate n random sequence xi є [a,b], n random sequence yi є [c,d] and n random sequence zi є [e,f] , then for m clusters of runs If you want to consolidate your m clusters of runs into just one cluster.

15 HIT OR MISS MONTE CARLO Find the AREA of the set of points (x,y) inside the unit square x,yϵ[0,1] that satisfy: Area=(length of interval1)x(length of interval2)x(number of hits)/(total count of generated random pairs) Area≈0.547

16 HIT OR MISS MONTE CARLO Find the VOLUME:

17 IF(AND(A3^2+B3^2<=C3^2,A3^2+B3^2+(C3-1)^2<=1),1,0)
x y z count RAND()*2-1 RAND()*2 IF(AND(A3^2+B3^2<=C3^2,A3^2+B3^2+(C3-1)^2<=1),1,0) 1 1 SUM(D3:D502) 205 D503/500*8 3.28

18 MONTE CARLO ERROR


Download ppt "MONTE CARLO SIMULATION"

Similar presentations


Ads by Google