CS667 Lecture 6: Monte Carlo Integration 02/10/05

Similar documents
Continuous Random Variables

Lecture 3 Gaussian Probability Distribution

Chapter 5 : Continuous Random Variables

1 Probability Density Functions

Expectation and Variance

The Regulated and Riemann Integrals

Numerical integration

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral

7.2 The Definite Integral

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

Recitation 3: More Applications of the Derivative

7 - Continuous random variables

Chapter 0. What is the Lebesgue integral about?

Definite integral. Mathematics FRDIS MENDELU

Sections 5.2: The Definite Integral

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Pi evaluation. Monte Carlo integration

Math 8 Winter 2015 Applications of Integration

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

Solution for Assignment 1 : Intro to Probability and Statistics, PAC learning

Math 426: Probability Final Exam Practice

Lecture 1: Introduction to integration theory and bounded variation

Lecture 1. Functional series. Pointwise and uniform convergence.

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as

Review of Calculus, cont d

Section 11.5 Estimation of difference of two proportions

MATH20812: PRACTICAL STATISTICS I SEMESTER 2 NOTES ON RANDOM VARIABLES

38.2. The Uniform Distribution. Introduction. Prerequisites. Learning Outcomes

Numerical Integration

Lecture 21: Order statistics

20 MATHEMATICS POLYNOMIALS

Line and Surface Integrals: An Intuitive Understanding

Math 113 Fall Final Exam Review. 2. Applications of Integration Chapter 6 including sections and section 6.8

Math 135, Spring 2012: HW 7

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1

Improper Integrals, and Differential Equations

5 Probability densities

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

Review of Riemann Integral

Week 10: Line Integrals

Math Calculus with Analytic Geometry II

1 The Riemann Integral

Monte Carlo method in solving numerical integration and differential equation

Math& 152 Section Integration by Parts

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

3.4 Numerical integration

Numerical Analysis: Trapezoidal and Simpson s Rule

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

38 Riemann sums and existence of the definite integral.

Integrals - Motivation

Best Approximation in the 2-norm

1 The Lagrange interpolation formula

Section 17.2 Line Integrals

Mapping the delta function and other Radon measures

Problem. Statement. variable Y. Method: Step 1: Step 2: y d dy. Find F ( Step 3: Find f = Y. Solution: Assume

4.1. Probability Density Functions

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Riemann Sums and Riemann Integrals

Lecture 3. Limits of Functions and Continuity

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

Lecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014

Lecture 20: Numerical Integration III

Riemann is the Mann! (But Lebesgue may besgue to differ.)

Riemann Sums and Riemann Integrals

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

The final exam will take place on Friday May 11th from 8am 11am in Evans room 60.

Main topics for the First Midterm

Chapter 3 Polynomials

Best Approximation. Chapter The General Case

Normal Distribution. Lecture 6: More Binomial Distribution. Properties of the Unit Normal Distribution. Unit Normal Distribution

SYDE 112, LECTURES 3 & 4: The Fundamental Theorem of Calculus

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

ODE: Existence and Uniqueness of a Solution

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

APPROXIMATE INTEGRATION

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

Overview of Calculus I

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

f(a+h) f(a) x a h 0. This is the rate at which

Section 5.1 #7, 10, 16, 21, 25; Section 5.2 #8, 9, 15, 20, 27, 30; Section 5.3 #4, 6, 9, 13, 16, 28, 31; Section 5.4 #7, 18, 21, 23, 25, 29, 40

The practical version

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Chapters 4 & 5 Integrals & Applications

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b.

Theoretical foundations of Gaussian quadrature

Math 113 Exam 2 Practice

Infinite Geometric Series

Reversing the Chain Rule. As we have seen from the Second Fundamental Theorem ( 4.3), the easiest way to evaluate an integral b

The Fundamental Theorem of Calculus

1B40 Practical Skills

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

11 An introduction to Riemann Integration

Joint distribution. Joint distribution. Marginal distributions. Joint distribution

4.4 Areas, Integrals and Antiderivatives

MATH 144: Business Calculus Final Review

Math 1B, lecture 4: Error bounds for numerical methods

Continuous Random Variables

Transcription:

CS667 Lecture 6: Monte Crlo Integrtion 02/10/05 Venkt Krishnrj Lecturer: Steve Mrschner 1 Ide The min ide of Monte Crlo Integrtion is tht we cn estimte the vlue of n integrl by looking t lrge number of rndom points in the domin of tht integrl nd dding up the vlues. In generl, we find tht s we increse the number of rndom points, the ddition of those vlues converge towrds the integrl. To illustrte the bove ide, let us use simple exmple. As shown bove, suppose we hve region in the squre nd we only know how to find if prticulr point is in it or not. If we drop one million rndom points on the squre, nd count how mny fll inside tht, we will get n pproximte mesure of the re (re frction in relity). Similr exmple Telephone poll sking yes/no question to estimte number of people who own crs. For this poll to work, we need to know size of popultion correctly, nd more importntly, ensure tht there is uniform chnce t selecting ny given person (so tht our finl results reflect the overll popultion). The bove exmples re just counting or computing re (in other words, integrting function tht is one or zero). But we cn extend this principle to integrte complex integrls whose vlues cnnot be nlyticlly esily determined. For exmple, we try nd compute the verge height of given terrin. To perform this experiment, we drop 1 million sticky leflets from plne nd we mesure the ltitude where ech of those sticky leflets lnd (or of ech of those leflets itself). We cn see tht the verge height of the terrin will be verge height over ll those leflets (however, we need to ensure tht the leflets re thrown in such wy tht they re uniformly distributed nd tht they re sticky so tht they dont collect t low lying regions or vlleys to give incorrect results). Another exmple, Telephone survey to compute verge income in the United Sttes. To perform 1

this experiment, we could go bout sking every person in US their income nd verging their responses (which is quite tedious tsk, nd probbly not possible). However, insted, we could pick subset, like sking thousnd people nd verging their responses to estimte the verge income. However, we need to be creful of two things here. Agin, s we hve seen in the previous cse, we hve to ensure unform distribution (ie the subset is good indictor of the US popultion in generl) Also, we need to tke into ccount tht with phone survey, you will only get verge over those people who own phones (weighted by how mny phone numbers they hve.) Another issue, if you survey 100 people nd hppen to include one CEO in tht survey, then the results could be quite misleding. Sy we get 99 people with verge income t 50k, nd one CEO with slry of 5 million (100 times the verge), the men will be bout 100k, which is inccurte. With more typicl person insted of the CEO, we would hve got men of 50K. This is sometimes the reson s to why we my compute medins insted of mens when possible. In reltion to grphics, this mens tht we need to be creful while integrting distribution with outliers (for exmple, scene with mny norml light sources nd few very bright light source.) If we integrte in the presence of outliers, we will tend to get incorrect results. 2 Quick review of probbility 2.1 Discrete Rndom Vrible Definition: A vrible tht tkes on one of finite number of different vlues for every tril of n experiment is clled Discrete Rndom Vrible Eg Throw die, define rndom vrible X s number tht comes up. X hs equl probbility of tking on the vlues 1, 2...6 (the 6 outcomes hppen eqully frequently). The probbility spce R is set of vlues X cn tke on, nd the distribution of X ssigns frequency or probbility to ech. I ll cll these elements ω 1...ω 6 Exmple for the die The die cn tke ny discrete vlue between 1 to 6. We shll cll this set R. Also, ech of those fce vlues re eqully likely. Thus, mthemticlly, R {1, 2,...6} nd p(i) 1 6 for ech i which is n element of {1, 2...6} Here ω i i We write X p(i), where p is the probbility distribution for X 2.1.1 A few mthemticl definitions Expected Vlue or Men E{x} n i1 p(ω i)ω i 2

This is number you will get if you tke mny smples of x nd verge their vlues. Eg for the die E{x} 1 6 1 +... 1 6 6 21 6 3.5 If we tke bunch of smples nd verge them, then we get the smple men which is n estimte of the expected vlue If Xi p, for i 1 to N (they re smples of X), then 1 n n i1 x i is n estimte of E{X} Linerity of expecttion E{X + Y } E{X} + E{Y } Vrince σ 2 {X} E{X E{X}} 2 n i1 p(ω i)(ω i E{X}) 2 The vrince tells us something bout how spred out the distribution is A hndy formul : σ 2 {x} E{X 2 } E{X} 2 Proof : σ 2 {X} E{X E{X}} 2 E{X 2 2XE{X} + E{X} 2 } E{X 2 } 2E{XE{X}} + E{E{X} 2 } E{X 2 } E{X} 2 since E{XE{X}} E{X}E{X} nd E{E{X} 2 } E{X} 2 Eg Vrince of die E{x 2 } 1 6 + 1 6 22 + 1 6 32 +... + 1 6 62 91 6 Then, σ 2 {X} E{X 2 } E{X} 2 91 6 ( 21 6 )2 2 11 Alterntive wy of getting the result : E{(X E{X}) 2 } 1 6 (1 3 1 2 )2 + 1 6 (2 3 1 2 )2 +... + 1 6 (6 3 1 2 )2 2 11 Definition σ{x} σ 2 {X} Reltion between stndrd devition σ{x} nd vrince Another simple exmple Ω {0, 1}p(1) p, p(0) 1 p E{X} 1 p + 0 (1 p) p E{X 2 } 1.p + 0.(1 p) p E{X} 2 p 2 σ 2 {X} p p 2 p(1 p) 3

Note tht for p 0 or p 1, vrince is zero 2.2 Continuous Cse In this cse, Ω is n infinite set (eg the rel intervl [0,1]) nd then the rndom vrible X is clled continuous rndom vrible. In the continuous cse, the probbility is mesure: it ssigns finite probbility for ny finite(suitble) subset of R. But for well behved distributions, we cn tlk bout probbility density function, or pdf, p(x), where p(x) is the probbility of lnding ner x p(x)dx P r { < x < + dx} (or from dx 2 to + dx 2 ) P r {X S} S dp where ω dp 1 Here, expected vlue is n integrl insted of sum: E{X} Ω xp(x)dx or Ω xdp(x) The reltions for the discrete cse hold true, viz E{X + Y } E{X} + E{Y } σ 2 {X} Ω (x x)dp(x) Sme mnipultion s before shows σ 2 {X} E{X 2 } E{X} 2 Simple exmple for continuous probbility : Uniform distribution from to b p(x) 1 (b ) p(x) b b X 4

P r (x [, b ]) [,b ] dp 1 b dx (b ) (b ) E{X} 1 2 b + 2 xdp xp(x)dx x b dx b 2 2 b Now, we will compute the vrince σ 2 {X} E{X 2 } E{X} 2 1 3 x 2 dp ( b + 2 )2 x 2 p(x)dx ( b + 2 )2 x 2 + dx (b b 2 )2 b 3 3 b b2 + b + 2 3 (b + 2 )2 b2 + 2 + 2b 4 4b2 + 4b + 4 2 3b 2 3 2 6b b2 2b + 2 (b )2 3 Monte Crlo Integrtion Bsed on the fct tht the expected vlue of n rndom vrible is n integrl, we cn compute this integrl experimentlly. The bsic form, we wnt to compute I Ω f(x)dx 5

We wnt to do it using rndom smples generted ccording to distribution p. This mens we will tke smples x i p, evlute some function g(x i ) nd verge : I 1 N i g(x i) We sw erlier tht E{I} E{g(x)} Ω g(x)p(x)dx So, wht do you wnt for g? Clerly g(x) f(x) p(x) E{ f(x) p(x) } f(x) Ω p(x).p(x)dx Ω f(x)dx This is the core ide While coding, we need to thus tke cre of 2 importnt spects : Wht kind of probbility distribution we re using Wht is the function tht we re integrting As we cn see, our estimted vlue my not be the exct vlue of the integrl, however, before trying to express vrince quntittively, there re two methods to lower it Importnce Smpling Strtifiction In the next clss, we shll see the bove two techniques nd lso derive mthemticl expression for the vrince of I, nd how it is relted to the vrince of g. 6