Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monte` Carlo Methods 1 MONTE` CARLO METHODS INTEGRATION and SAMPLING TECHNIQUES.

Similar presentations


Presentation on theme: "Monte` Carlo Methods 1 MONTE` CARLO METHODS INTEGRATION and SAMPLING TECHNIQUES."— Presentation transcript:

1 Monte` Carlo Methods 1 MONTE` CARLO METHODS INTEGRATION and SAMPLING TECHNIQUES

2 Monte` Carlo Methods2 THE BOOK by THE MAN

3 Monte` Carlo Methods3 PROBLEM STATEMENT System of equations and inequalities defines a region in m-spaceSystem of equations and inequalities defines a region in m-space Determine the volume of the regionDetermine the volume of the region

4 Monte` Carlo Methods4 HISTORY 19 th C. simple integral like E[X] using straight-forward sampling19 th C. simple integral like E[X] using straight-forward sampling System of PDE solved using sample paths of Markov ChainsSystem of PDE solved using sample paths of Markov Chains –Rayleigh 1899 –Markov 1931 Particles through a medium solved using Poisson Process and Random WalkParticles through a medium solved using Poisson Process and Random Walk –Manhattan Project Combinatorics in the ’80’s in RTP, NCCombinatorics in the ’80’s in RTP, NC

5 Monte` Carlo Methods5 GROOMING R = volumetric regionR = volumetric region R confined to [0,1] mR confined to [0,1] m  (R) = volume Generalized area-under-the- curve problemGeneralized area-under-the- curve problem

6 Monte` Carlo Methods6 ALGORITHM for i=1 to nfor i=1 to n –generate x in [0,1] m –is x in R? S=S+1S=S+1 endend  (R)=S/n

7 Monte` Carlo Methods7 MESH Generate x’s as a mesh of evenly spaced pointsGenerate x’s as a mesh of evenly spaced points Each point is 1/k from its nearest neighborEach point is 1/k from its nearest neighbor n=k mn=k m Many varieties of this method, generally called Multi-GridMany varieties of this method, generally called Multi-Grid

8 Monte` Carlo Methods8 ERROR CONTROL Define a(R) = the surface area of RDefine a(R) = the surface area of R a(R)/k = volume of a swath around the surface 1/k thicka(R)/k = volume of a swath around the surface 1/k thick a(R)/k=a(R)/(n 1/m ) bounds errora(R)/k=a(R)/(n 1/m ) bounds error

9 Monte` Carlo Methods9...more ERROR CONTROL

10 Monte` Carlo Methods10...more ERROR If we require error less than ...If we require error less than ... the required sample n grows like x mthe required sample n grows like x m

11 Monte` Carlo Methods11 PROBABLY NOT THAT BAD Reaction: the boundary of R isn’t usually so-alignedReaction: the boundary of R isn’t usually so-aligned Probability statement on the functions?Probability statement on the functions? –this math exists but is only marginally helpful with applied problems

12 Monte` Carlo Methods12 ALTERNATIVE Monte` Carlo MethodMonte` Carlo Method for i = 1 to nfor i = 1 to n –sample x from Uniform[0,1] m –is x in R? S = S + 1S = S + 1 endend  hat = S/n

13 Monte` Carlo Methods13 STATISTICAL TREATMENT S is now a RANDOM VARIABLES is now a RANDOM VARIABLE P[x in R] = P[x in R] =  –(volume of R)/(volume of unit hyper-cube) S is a sum of Bernoulli TrialsS is a sum of Bernoulli Trials S is Binomial(n, )S is Binomial(n, ) E[S] =  nE[S] =  n VAR[S] = n  (1-  )VAR[S] = n  (1-  )

14 Monte` Carlo Methods14 ESTIMATOR

15 Monte` Carlo Methods15 CHEBYCHEV’S INEQUALITY Bounds Tails of DistributionsBounds Tails of Distributions Z~F, E[Z]=0, VAR[Z]=  2,  > 0Z~F, E[Z]=0, VAR[Z]=  2,  > 0

16 Monte` Carlo Methods16 To get an error (statistical) bounded by ...To get an error (statistical) bounded by ...

17 Monte` Carlo Methods17 SIMPLER BOUNDS  (1-  ) is bounded by ¼ n = 1/(4  2  )n = 1/(4  2  ) Does not depend on m!Does not depend on m!

18 Monte` Carlo Methods18 SPREADSHEET Find the volume of a sphere centered at (0.5, 0.5, 0.5) with radius 0.5 in [0,1] 3Find the volume of a sphere centered at (0.5, 0.5, 0.5) with radius 0.5 in [0,1] 3 Chebyshev bounds look very loose compared with VAR( hat)Chebyshev bounds look very loose compared with VAR( hat) Use hat for in the sample size formulaUse hat for in the sample size formula Slow convergenceSlow convergence

19 Monte` Carlo Methods19 STRATIFIED SAMPLING Best of Mesh and Sampling MethodsBest of Mesh and Sampling Methods Very General application of Variance ReductionVery General application of Variance Reduction –survey sampling –experimental design –optimization via simulation

20 Monte` Carlo Methods20 PARAMETERS AND DEFINITIONS n = total number of sample pointsn = total number of sample points Sample region [0,1] m is divided into r subregions A 1, A 2,..., A rSample region [0,1] m is divided into r subregions A 1, A 2,..., A r p i = P[x in A i ]p i = P[x in A i ] k(x) =k(x) = –1 if x in R –0 otherwise –so E[k(x)] = –so E[k(x)] =

21 Monte` Carlo Methods21 DENSITY OF SAMPLES x f(x) is the m-dim density function of xf(x) is the m-dim density function of x –for generality –so we keep track of expectations –in our current scheme, f(x) = 1

22 Monte` Carlo Methods22 LAMBDA AYE

23 Monte` Carlo Methods23 STRATIFICATION old method: generate x’s across the whole regionold method: generate x’s across the whole region new method: generate the EXPECTED number of samples in each subregionnew method: generate the EXPECTED number of samples in each subregion

24 Monte` Carlo Methods24 let X j be the jth sample in the old methodlet X j be the jth sample in the old method capitols indicate random samples!

25 Monte` Carlo Methods25 VARIANCE OF THE ESTIMATOR

26 Monte` Carlo Methods26 STRATIFICATION Generate n 1, n 2,..., n r samples from A 1, A 2,..., A rGenerate n 1, n 2,..., n r samples from A 1, A 2,..., A r –on purpose n i = np in i = np i n i sum to nn i sum to n X i,j is jth sample from A iX i,j is jth sample from A i

27 Monte` Carlo Methods27  i is a conditional expectation

28 Monte` Carlo Methods28

29 Monte` Carlo Methods29

30 Monte` Carlo Methods30

31 Monte` Carlo Methods31 HOW THAT LAST BIT WORKED

32 Monte` Carlo Methods32...AND SO... Stratification reduces the variance of the estimatorStratification reduces the variance of the estimator A random quantity (the samples pulled from A i ) is replaced by its expectationA random quantity (the samples pulled from A i ) is replaced by its expectation This only works because of all of the SUMMATION and no other complicated functionsThis only works because of all of the SUMMATION and no other complicated functions

33 Monte` Carlo Methods33 FOR THE SPHERE PROBLEM 500 samples500 samples –Divide evenly in 64 cubes 4 X 4 X 44 X 4 X 4 7 or 8 samples in each cube7 or 8 samples in each cube –64 separate ’s –Add together How did we know to start with 500?How did we know to start with 500?

34 Monte` Carlo Methods 34 Discussion of applications...


Download ppt "Monte` Carlo Methods 1 MONTE` CARLO METHODS INTEGRATION and SAMPLING TECHNIQUES."

Similar presentations


Ads by Google