资源描述:
《Monte-Carlo与积分计算课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第九章MonteCarlo积分第九章MonteCarlo积分MonteCarlo法的重要应用领域之一:计算积分和多重积分适用于求解:被积函数、积分边界复杂,难以用解析方法或一般的数值方法求解;被积函数的具体形式未知,只知道由模拟返回的函数值。本章内容:用MonteCarlo法求定积分的几种方法:均匀投点法、期望值估计法、重要抽样法、半解析法、…第九章MonteCarlo积分Goal:Evaluateanintegral:Whyuserandommethods?Computationby“det
2、erministicquadrature”canbecomeexpensiveandinaccurate.gridpointsaddupquicklyinhighdimensionsbadchoicesofgridmaymisrepresentg(x)第九章MonteCarlo积分MonteCarlomethodcanbeusedtocomputeintegralofanydimensiond(d-foldintegrals)Errorcomparisonofd-foldintegralsSim
3、pson’srule,…purelystatistical,notrelyonthedimension!MonteCarlomethodWINS,whend>>3MonteCarlomethodapproximatingtheintegralofafunctionfusingquadraticpolynomials第九章MonteCarlo积分Hit-or-MissMethodSampleMeanMethodVarianceReductionTechniqueVarianceReductionu
4、singRejectionTechniqueImportanceSamplingMethodHit-or-MissMethodEvaluationofadefiniteintegralabhXXXXXXOOOOOOOProbabilitythatarandompointresideinsidetheareaN:TotalnumberofpointsM:pointsthatresideinsidetheregionHit-or-MissMethodSampleuniformlyfromtherec
5、tangularregion[a,b]x[0,h]TheprobabilitythatwearebelowthecurveisSo,ifwecanestimatep,wecanestimateI:whereisourestimateofpHit-or-MissMethodWecaneasilyestimatep:throwN“uniformdarts”attherectangleletletMbethenumberoftimesyouendupunderthecurvey=g(x)Hit-or-
6、MissMethodabhXXXXXXOOOOOOOStartSetN:largeintegerM=0Chooseapointxin[a,b]Chooseapointyin[0,h]if[x,y]resideinsidethenM=M+1I=(b-a)h(M/N)EndLoopNtimesHit-or-MissMethodErrorAnalysisoftheHit-or-MissMethodItisimportanttoknowhowaccuratetheresultofsimulationsa
7、renotethatMisbinomial(M,p)第九章MonteCarlo积分Hit-or-MissMethodSampleMeanMethodVarianceReductionTechniqueVarianceReductionusingRejectionTechniqueImportanceSamplingMethodSampleMeanMethodStartSetN:largeintegers1=0,s2=0xn=(b-a)un+ayn=r(xn)s1=s1+yn,s2=s2+yn2E
8、stimatemeanm’=s1/NEstimatevarianceV’=s2/N–m’2EndLoopNtimesSampleMeanMethodWritethisas:whereX~unif(a,b)SampleMeanMethodwhereX~unif(a,b)So,wewillestimateIbyestimatingE[g(X)]withwhereX1,X2,…,Xnisarandomsamplefromtheuniform(a,b)distribution.SampleMeanMet