531f10MCIb

531f10MCIb - STAT 531: Monte-Carlo Integration HM Kim...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 531: Monte-Carlo Integration HM Kim Department of Mathematics and Statistics University of Calgary Fall 2010 1/24
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
When an iid sample X 1 , ··· , X n is obtained from p , we can approximate μ by a sample average, by the WLLN, 1 n n i =1 h ( X i ) = ¯ h n Z X h ( x ) p ( x ) dx = E p [ h ( X )] = μ 1 n n i =1 X i = ¯ x n Z X xp ( x ) dx = E p [ X ] = μ ! 1 generate a sample ( X 1 , ··· , X n ) from the density p 2 propose as an approximation the empirical average ¯ h n = 1 n h ( x j ) Fall 2010 2/24
Background image of page 2
¯ h n = 1 n h ( x j ) converges almost surely to E [ h ( X )] = R h ( X ) p ( X ) dx the asymptotic variance of the approximation can be estimated from ( X 1 , ··· , X n ) through v n = 1 n 2 [ h ( x j ) - ¯ h n ] 2 n ( ¯ h n - E [ h ( X )]) v n approximately N (0 , 1) by CLT Fall 2010 3/24
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
, Example : Let X N (0 , 1). Find P ( X > 4 . 5) . P ( X 4 . 5) = Z 4 . 5 1 2 π e - x 2 / 2 dx Let z = 1 x , Z 4 . 5 1 2 π e - x 2 / 2 dx = Z 1 / 4 . 5 0 1 z 2 2 π e - / 2 z 2 dz Let g ( z ) = 1 z 2 2 π e - z 2 / 2 . Z 1 / 4 . 5 0 1 4 . 5 g ( z )4 . 5 dz 1 n 1 4 . 5 g ( u ) | {z } h ( u ) where u unif ( 0 , 1 4 . 5 ) and p ( u ) = 4 . 5. Fall 2010 4/24
Background image of page 4
> h=function(x){ 1/(x^2*sqrt(2*pi)*exp(1/(2*x^2)))} > par(mfrow=c(2,1)) > curve(h,from=0,to=1/4.5,xlab="x",ylab="h(x)",lwd="2") > > I= (1/4.5)*h(runif(10^4)/4.5) > estint= cumsum(I)/(1:10^4) > esterr= sqrt(cumsum((I-estint)^2))/(1:10^4) > plot(estint,xlab="Iterations",ty="l",lwd=2, ylim=mean(I)+20*c(-esterr[10^4],esterr[10^4]),ylab="") > lines(estint+2*esterr,col="gold",lwd=2) > lines(estint-2*esterr,col="gold",lwd=2) > estint[10000] [1] 3.358573e-06 > esterr[10000] [1] 1.085044e-07 > integrate(h,0,1/4.5) 3.397673e-06 with absolute error < 1.2e-10 > pnorm(-4.5) [1] 3.397673e-06 Fall 2010 5/24
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fall 2010 6/24
Background image of page 6
Barely relevant sampling Fall 2010 7/24
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 24

531f10MCIb - STAT 531: Monte-Carlo Integration HM Kim...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online