Hit-and-Miss (or Rejection) Monte Carlo Method: a “brute-force” method based on completely random sampling Then, how do we throw the stones and count them.

Slides:



Advertisements
Similar presentations
Introduction to Monte Carlo Markov chain (MCMC) methods
Advertisements

The Simple Regression Model
Statistical Techniques I EXST7005 Sample Size Calculation.
 These 100 seniors make up one possible sample. All seniors in Howard County make up the population.  The sample mean ( ) is and the sample standard.
Propagation of Error Ch En 475 Unit Operations. Quantifying variables (i.e. answering a question with a number) 1. Directly measure the variable. - referred.
Topic 6: Introduction to Hypothesis Testing
Graduate School of Information Sciences, Tohoku University
Copyright © 2006 Pearson Addison-Wesley. All rights reserved. Lecture 4: Mathematical Tools for Econometrics Statistical Appendix (Chapter 3.1–3.2)
Importance Sampling. What is Importance Sampling ? A simulation technique Used when we are interested in rare events Examples: Bit Error Rate on a channel,
Understanding the Accuracy of Assembly Variation Analysis Methods ADCATS 2000 Robert Cvetko June 2000.
Machine Learning CUNY Graduate Center Lecture 7b: Sampling.
Estimating Surface Area The art of math…. Estimating the Surface Area of 3-D Objects  You can’t always get an exact answer when looking for the surface.
MAE 552 Heuristic Optimization
1 Lecture 12 Monte Carlo methods in parallel computing Parallel Computing Fall 2008.
Simulation Modeling and Analysis Session 12 Comparing Alternative System Designs.
Topic 2: Statistical Concepts and Market Returns
Statistics.
Generating Continuous Random Variables some. Quasi-random numbers So far, we learned about pseudo-random sequences and a common method for generating.
Accuracy of Prediction How accurate are predictions based on a correlation?
End of Chapter 8 Neil Weisenfeld March 28, 2005.
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
2.3. Measures of Dispersion (Variation):
Need to know in order to do the normal dist problems How to calculate Z How to read a probability from the table, knowing Z **** how to convert table values.
The Central Limit Theorem For simple random samples from any population with finite mean and variance, as n becomes increasingly large, the sampling distribution.
QUIZ CHAPTER Seven Psy302 Quantitative Methods. 1. A distribution of all sample means or sample variances that could be obtained in samples of a given.
Standard error of estimate & Confidence interval.
Chapter 6: Sampling Distributions
Ewa Lukasik - Jakub Lawik - Juan Mojica - Xiaodong Xu.
1 Sampling and Sampling Distributions Dr. Jerrell T. Stracener, SAE Fellow Leadership in Engineering EMIS 7370/5370 STAT 5340 : PROBABILITY AND STATISTICS.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on the Least-Squares Regression Model and Multiple Regression 14.
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
1 Theoretical Physics Experimental Physics Equipment, Observation Gambling: Cards, Dice Fast PCs Random- number generators Monte- Carlo methods Experimental.
Montecarlo Simulation LAB NOV ECON Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.
 Consider the following "experiment" where you construct a catapult which launches a dart at a target.  The object is to hit the bulls eye. Topic 1.2.
Machine Learning Lecture 23: Statistical Estimation with Sampling Iain Murray’s MLSS lecture on videolectures.net:
Determining the Sample Size. Doing research costs… Power of a hypothesis test generally is an increasing function of sample size. Margin of error is generally.
Lecture 4 Basic Statistics Dr. A.K.M. Shafiqul Islam School of Bioprocess Engineering University Malaysia Perlis
P T A typical experiment in a real (not virtual) space 1.Some material is put in a container at fixed T & P. 2.The material is in a thermal fluctuation,
1 SMU EMIS 7364 NTU TO-570-N Inferences About Process Quality Updated: 2/3/04 Statistical Quality Control Dr. Jerrell T. Stracener, SAE Fellow.
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
Hit-and-Miss (or Rejection) Monte Carlo Method:
1 Everyday Statistics in Monte Carlo Shielding Calculations  One Key Statistics: ERROR, and why it can’t tell the whole story  Biased Sampling vs. Random.
1 Chapter 7 Sampling Distributions. 2 Chapter Outline  Selecting A Sample  Point Estimation  Introduction to Sampling Distributions  Sampling Distribution.
4. Numerical Integration. Standard Quadrature We can find numerical value of a definite integral by the definition: where points x i are uniformly spaced.
Propagation of Error Ch En 475 Unit Operations. Quantifying variables (i.e. answering a question with a number) 1. Directly measure the variable. - referred.
Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics.
Statistics Presentation Ch En 475 Unit Operations.
Monte-Carlo Simulation. Mathematical basis The discounted price is a martingale (MA4257 and MA5248).
Computer simulation Sep. 9, QUIZ 2 Determine whether the following experiments have discrete or continuous out comes A fair die is tossed and the.
Hypothesis test flow chart frequency data Measurement scale number of variables 1 basic χ 2 test (19.5) Table I χ 2 test for independence (19.9) Table.
CHAPTER 5 Simulation Modeling. Introduction In many situations a modeler is unable to construct an analytic (symbolic) model adequately explaining the.
Introduction to Inference Sampling Distributions.
Statistics Presentation Ch En 475 Unit Operations.
Sampling Distributions: Suppose I randomly select 100 seniors in Anne Arundel County and record each one’s GPA
Variance Stabilizing Transformations. Variance is Related to Mean Usual Assumption in ANOVA and Regression is that the variance of each observation is.
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp.
Ka-fu Wong © 2007 ECON1003: Analysis of Economic Data Lesson0-1 Supplement 2: Comparing the two estimators of population variance by simulations.
The accuracy of averages We learned how to make inference from the sample to the population: Counting the percentages. Here we begin to learn how to make.
This represents the most probable value of the measured variable. The more readings you take, the more accurate result you will get.
Bias-Variance Analysis in Regression  True function is y = f(x) +  where  is normally distributed with zero mean and standard deviation .  Given a.
Virtual University of Pakistan
Square and Cube Numbers
Arithmetic Mean This represents the most probable value of the measured variable. The more readings you take, the more accurate result you will get.
Ch13 Empirical Methods.
Additional notes on random variables
Confidence intervals for the difference between two means: Independent samples Section 10.1.
Additional notes on random variables
Simulation Part 1: Simulation with Discrete Random Variables
2.3. Measures of Dispersion (Variation):
Lecture 9 Randomized Algorithms
Presentation transcript:

Hit-and-Miss (or Rejection) Monte Carlo Method: a “brute-force” method based on completely random sampling 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) x y A O 1 1 (x i,y i )

Obtain an approximate value of A (=  /4  M/M) by (1) throwing M stones in the square of the total area 1; (2) counting M stones in a quarter of the circle of the radius 1. Lab 1. Calculation of the value of  /4 Simple, Brute-Force, Hit-and-Miss Monte Carlo Method 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 O i values at each microstate (x i, y i ) (i = 1 to M). (1)What values can O i take? (2) How does the value of O i depend on (x i, y i )?

Obtain an approximate value of A (=  /4  M/M) by (1) throwing M stones in the square of the total area 1; (2) counting M stones in a quarter of the circle of the radius 1. Lab 1. Calculation of the value of  /4 Simple, Brute-Force, Hit-and-Miss Monte Carlo Method 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 O i values at each microstate (x i, y i ) (i = 1 to M). (1)What values can O i take? Answer: 0 or 1 (2) How does the value of O i depend on (x i, y i )? Answer:

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

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

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

Flow chart for Question 4: Calculate . O tot = O tot + O O = 0.0 no x=ran3(&seed); y=ran3(&seed) i = 1 i = i + 1 no O tot = 0; input seed O bar = O tot /M;  = 4O bar ;  true = acos(-1);  = fabs(  true  ) yes O = 1.0 yes

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

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?

Lab 1. Calculation of the value of  /4 (or  ) Variance, Standard Deviation, Error, and Accuracy

Lab 1. Calculation of the value of  /4 (or  ) Variance, Standard Deviation, Error, and Accuracy

Flow chart for Question 7: Calculate . O tot = O tot + O; O 2 tot = O 2 tot + O 2 O = 0.0 O = 1.0 yes no x=ran3(&seed); y=ran3(&seed) i = 1 i = i + 1 no O tot = 0; O 2 tot =0; input seed O bar = O tot /M; O 2 bar = O 2 tot /M;  = sqrt(O 2 bar  O bar 2 ) yes pi = 4 x O bar ;  _pi = 4 x 

Lab 1. Calculation of the value of  /4 (or  ) 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?

Lab 1. Calculation of the value of  /4 (or  )

O tot = O tot + O; O 2 tot = O 2 tot + O 2 O = 0.0 O = 1.0 yes no x=ran3(&seed); y=ran3(&seed) i = 1 i = i + 1 no O tot = 0; O 2 tot =0 O bar = O tot /M; O 2 bar = O 2 tot /M;  = sqrt(O 2 bar  O bar 2 ) yes pi = 4 x O bar ;  _pi = 4 x  one_estimate Flow chart for Question 9: Calculate  over n estimates.

Flow chart for Question 9: Calculate  over n estimates. O bartot = O bartot + O bar O barsqtot = O barsqtot + O bar 2  tot =  tot +  one_estimate j = 1 j = j + 1 no O bartot = 0; O barsqtot =0;  tot = 0; input seed O barbar = O bartot /n O barsqbar = O barsqtot /n  bar = sqrt(O barsqbar  O barbar 2 )  bar =  tot /n yes pi = 4xO barbar ;  barpi = 4x  bar ;  barpi = 4x  bar

Lab 1. Calculation of the value of 

Lab 1. Calculation of the value of  /4 (or  ) 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.

Lab 1. Calculation of the value of  /4 (or  )