prabhas chongstitvatana1 monte carlo integration it is a numerical probabilistic algorithm ab...

5
Prabhas Chongstitvatana 1 Monte Carlo integration It is a numerical probabilistic algorithm b a dx x f I ) ( a b I/(b- a) f

Upload: elaine-rose

Post on 19-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Prabhas Chongstitvatana1 Monte Carlo integration It is a numerical probabilistic algorithm ab I/(b-a) f

Prabhas Chongstitvatana 1

Monte Carlo integration

It is a numerical probabilistic algorithm

b

a

dxxfI )(

a b

I/(b-a)

f

Page 2: Prabhas Chongstitvatana1 Monte Carlo integration It is a numerical probabilistic algorithm ab I/(b-a) f

Prabhas Chongstitvatana 2

I/(b-a)

b-a

MCint(f,n,a,b)

sum = 0

For i = 1 to n do

x = uniform(a,b)

sum = sum + f(x)

Return ( b-a) * (sum/n)

Page 3: Prabhas Chongstitvatana1 Monte Carlo integration It is a numerical probabilistic algorithm ab I/(b-a) f

Prabhas Chongstitvatana 3

Variance of the estimate is inverse proportion to n

The expected error is proportion to n/1

A deterministic algorithm for integration will sample at regular interval.

Page 4: Prabhas Chongstitvatana1 Monte Carlo integration It is a numerical probabilistic algorithm ab I/(b-a) f

Prabhas Chongstitvatana 4

DETint(f,n,a,b)

sum = 0

delta = (b-a)/n

x = a + delta/2

For I = 1 to n do

sum = sum + f(x)

x = x + delta

Return sum * delta

Page 5: Prabhas Chongstitvatana1 Monte Carlo integration It is a numerical probabilistic algorithm ab I/(b-a) f

Prabhas Chongstitvatana 5

Advantage of MCint when doing multiple integral in high dimension. As the sample point increases exponentially with the dimension.

Example 100, 100x100, 100x100x100. MCint is faster than a deterministic algorithm for dimension >= 4.