Monte-Carlo與積分計算電子教案_第1頁
Monte-Carlo與積分計算電子教案_第2頁
Monte-Carlo與積分計算電子教案_第3頁
Monte-Carlo與積分計算電子教案_第4頁
Monte-Carlo與積分計算電子教案_第5頁
已閱讀5頁,還剩35頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

第九章

MonteCarlo積分第九章MonteCarlo積分MonteCarlo法的重要應(yīng)用領(lǐng)域之一:計算積分和多重積分適用于求解:被積函數(shù)、積分邊界復(fù)雜,難以用解析方法或一般的數(shù)值方法求解;被積函數(shù)的具體形式未知,只知道由模擬返回的函數(shù)值。本章內(nèi)容:用MonteCarlo法求定積分的幾種方法:均勻投點法、期望值估計法、重要抽樣法、半解析法、…第九章MonteCarlo積分Goal:Evaluateanintegral:Whyuserandommethods?Computationby“deterministicquadrature”canbecomeexpensiveandinaccurate.gridpointsaddupquicklyinhighdimensionsbadchoicesofgridmaymisrepresentg(x)第九章MonteCarlo積分MonteCarlomethodcanbeusedtocomputeintegralofanydimensiond(d-foldintegrals)Errorcomparisonofd-foldintegralsSimpson’srule,…purelystatistical,notrelyonthedimension!MonteCarlomethodWINS,whend>>3MonteCarlomethodapproximatingtheintegralofafunctionfusingquadraticpolynomials第九章MonteCarlo積分Hit-or-MissMethodSampleMeanMethodVarianceReductionTechniqueVarianceReductionusingRejectionTechniqueImportanceSamplingMethodHit-or-MissMethodEvaluationofadefiniteintegralabhXXXXXXOOOOOOOProbabilitythatarandompointresideinsidetheareaN:TotalnumberofpointsM:pointsthatresideinsidetheregionHit-or-MissMethodSampleuniformlyfromtherectangularregion[a,b]x[0,h]TheprobabilitythatwearebelowthecurveisSo,ifwecanestimatep,wecanestimateI:whereisourestimateofpHit-or-MissMethodWecaneasilyestimatep:throwN“uniformdarts”attherectangleletletMbethenumberoftimesyouendupunder thecurvey=g(x)Hit-or-MissMethodabhXXXXXXOOOOOOOStartSetN:largeinteger

M=0Chooseapointxin[a,b]Chooseapointyin[0,h]if[x,y]resideinsidethenM=M+1I=(b-a)h(M/N)EndLoopNtimesHit-or-MissMethodErrorAnalysisoftheHit-or-MissMethodItisimportanttoknowhowaccuratetheresultofsimulationsare

notethatMisbinomial(M,p)第九章MonteCarlo積分Hit-or-MissMethodSampleMeanMethodVarianceReductionTechniqueVarianceReductionusingRejectionTechniqueImportanceSamplingMethodSampleMeanMethodStartSetN:largeinteger

s1=0,s2=0xn=(b-a)un+ayn=r(xn)s1=s1+yn,s2=s2+yn2Estimatemeanm’=s1/NEstimatevarianceV’=s2/N–m’2EndLoopNtimesSampleMeanMethodWritethisas:whereX~unif(a,b)SampleMeanMethodwhereX~unif(a,b)So,wewillestimateIbyestimatingE[g(X)]withwhereX1,X2,…,Xnisarandomsamplefromtheuniform(a,b)distribution.SampleMeanMethodExample:(weknowthattheanswerise3-119.08554)writethisaswhereX~unif(0,3)SampleMeanMethodwritethisaswhereX~unif(0,3)estimatethiswithwhereX1,X2,…,Xnarenindependentunif(0,3)’s.SampleMeanMethodSimulationResults:true=19.08554,n=100,000

1 19.107242 19.082603 18.972274 19.068145 19.13261 SimulationSampleMeanMethodDon’tevergiveanestimatewithoutaconfidenceinterval!Thisestimatoris“unbiased”:SampleMeanMethodSampleMeanMethodanapproximationSampleMeanMethodX1,X2,…,Xniid->g(X1),g(X2),…,g(Xn)iidLetYi=g(Xi)fori=1,2,…,nThenandwecanonceagaininvoketheCLT.SampleMeanMethodForn“l(fā)argeenough”(n>30),So,aconfidenceintervalforIisroughlygivenbybutsincewedon’tknow,we’llhavetobecontentwiththefurtherapproximation:SampleMeanMethodBytheway…NooneeversaidthatyouhavetousetheuniformdistributionExample:whereX~exp(rate=2).SampleMeanMethodComparisonofHit-and-MissandSampleMeanMonteCarloLetbethehit-and-missestimatorofIThenLetbethesamplemeanestimatorofISampleMeanMethodComparisonofHit-and-MissandSampleMeanMonteCarloSamplemeanMonteCarloisgenerallypreferredoverHit-and-MissMonteCarlobecause:theestimatorfromSMMChaslowervarianceSMMCdoesnotrequireanon-negativeintegrand (oradjustments)H&MMCrequiresthatyoubeabletoputg(x)ina “box”,soyouneedtofigureoutthemax valueofg(x)over[a,b]andyouneedtobe integratingoverafiniteintegral.2.1VarianceReductionTechnique-Introduction第九章MonteCarlo積分Hit-or-MissMethodSampleMeanMethodVarianceReductionTechniqueVarianceReductionusingRejectionTechniqueImportanceSamplingMethodVarianceReductionTechniqueIntroductionMonteCarloMethodandSamplingDistributionMonteCarloMethod:TakevaluesfromrandomsampleFromcentrallimittheorem,3sruleMostprobableerrorImportantcharacteristicsVarianceReductionTechniqueIntroductionReducingerror*100samplesreducestheerrororderof10ReducingvarianceVarianceReductionTechniqueThevalueofvarianceiscloselyrelatedtohowsamplesaretakenUnbiasedsamplingBiasedsamplingMorepointsaretakeninimportantpartsofthepopulationVarianceReductionTechniqueMotivationIfweareusingsample-meanMonteCarloMethodVariancedependsverymuchonthebehaviorofr(x)r(x)varieslittlevarianceissmallr(x)=constvariance=0EvaluationofaintegralNearminimumpointscontributelesstothesummationNearmaximumpointscontributemoretothesummationMorepointsaresamplednearthepeak”importancesamplingstrategy”第九章MonteCarlo積分1.2Hit-or-MissMethod1.3SampleMeanMethod2.1VarianceReductionTechnique2.3VarianceReductionusingRejectionTechnique2.4ImportanceSamplingMethodVarianceReductionTechniqueVarianceReductionforHit-or-MissmethodInthedomain[a,b]chooseacomparisonfunctionabw(x)XXXXXOOOOOOOr(x)Pointsaregeneratedontheareaunderw(x)functionRandomvariablethatfollowsdistributionw(x)VarianceReductionTechniquePointslyingabover(x)isrejectedq10P(q)r1-rabw(x)XXXXXOOOOOOOr(x)VarianceReductionTechniqueErrorAnalysisHitorMissmethodErrorreductionVarianceReductionTechniqueStartSetN:largeinteger

N’=0Generateu1,x=W-1(Au1)Generateu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論