Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hit-and-Miss (or Rejection) Monte Carlo Method:

Similar presentations


Presentation on theme: "Hit-and-Miss (or Rejection) Monte Carlo Method:"— Presentation transcript:

1 Hit-and-Miss (or Rejection) Monte Carlo Method:
a “brute-force” method based on completely random sampling x y A O 1 (xi,yi) Then, how do we throw the stones and count them on computer? 1. Generation of M 2D microstates 2. Measurement (Averaging an observable over M microstates)

2 Lab 1. Calculation of the value of 
Simple, Brute-Force, Hit-and-Miss Monte Carlo Method Obtain an approximate value of A (= /4  M/M) by throwing M stones in the square of the total area 1; counting M stones in a quarter of the circle of the radius 1. Question 1 (Formulation of the problem = Restatement of the last page). On computer, this problem can be formulated as obtaining the average (or expectation value) of an observable O over M instantaneous Oi values at each microstate (xi, yi) (i = 1 to M). What values can Oi take? (2) How does the value of Oi depend on (xi, yi)?

3 Lab 1. Calculation of the value of 
Simple, Brute-Force, Hit-and-Miss Monte Carlo Method Obtain an approximate value of A (= /4  M/M) by throwing M stones in the square of the total area 1; counting M stones in a quarter of the circle of the radius 1. Question 1 (Formulation of the problem = Restatement of the last page). On computer, this problem can be formulated as obtaining the average (or expectation value) of an observable O over M instantaneous Oi values at each microstate (xi, yi) (i = 1 to M). What values can Oi take? Answer: 0 or 1 (2) How does the value of Oi depend on (xi, yi)? Answer:

4 Lab 1. Calculation of the value of 
Question 2 (Algorithm & Flow chart). Draw a flow chart to estimate 4A by averaging over M instantaneous Oi values.

5 Lab 1. Calculation of the value of 
Otot = Otot + O O = 0.0 O = 1.0 yes no x=ran3(&seed) y=ran3(&seed) i = 1 i = i + 1 Otot = 0.0 Obar = Otot/M x 4 Question 2 (Algorithm & Flow chart). Draw a flow chart to estimate 4A by averaging over M instantaneous Oi values.

6 Lab 1. Calculation of the value of 
Question 3. Write a program to estimate 4A by averaging over M instantaneous O values. Try M = 10,000.

7 Lab 1. Calculation of the value of 
Question 3. Write a program to estimate 4A by averaging over M instantaneous O values. Try M = 10,000.

8 Lab 1. Calculation of the value of 
Question 6. But, what if we don’t know the true value of what we estimate? Since we can’t estimate the error  w.r.t. the true value, how could we estimate the accuracy (error) of the simulation?

9 Lab 1. Calculation of the value of 
Variance, Standard Deviation, Error, and Accuracy

10 Lab 1. Calculation of the value of 
Variance, Standard Deviation, Error, and Accuracy

11 Lab 1. Calculation of the value of 
Answer: We expected that  would be similar to  (  ), but it’s not the case ( > ).  (~constant with M) is much larger than  (which decreases as M increases)! Thus,  itself is not a good indicator of the accuracy of a simulation. Question 8. Then, what else would be an indicator of the accuracy (error) of the estimation, when we don’t know the true value of what we estimate?

12 Lab 1. Calculation of the value of 

13 Lab 1. Calculation of the value of 

14 Lab 1. Calculation of the value of 
Question 10. But, what if we move onto a very complex problem? Each estimation (simulation) with M trials becomes so time-consuming that we couldn’t afford to running the simulation many times. What should we do in this case? Answer: Let’s try to find a way to estimate the accuracy  from one M-trial simulation.

15 Lab 1. Calculation of the value of 

16 Lab 1. Calculation of the value of 


Download ppt "Hit-and-Miss (or Rejection) Monte Carlo Method:"

Similar presentations


Ads by Google