Transcription of Importance Sampling - Astrostatistics
1 ReferencesImportance SamplingJessi CisewskiCarnegie Mellon UniversityJune 2014 JessiCisewski (CMU) Importance SamplingReferencesOutline1 Recall:Monte Carlo integration2 Importance Sampling3 Examplesof Importance Sampling (a)MonteCarlo, Monaco(b)MonteCarlo Casino?Some content and examples from Wasserman (2004)JessiCisewski (CMU) Importance SamplingReferencesSimpleillustration: what is ?Area Area = r2(2r)(2r)= 4 JessiCisewski (CMU) Importance SamplingReferencesMonteCarlo Integration: motivationI= bah(y)dyGoal:evaluate this integralSometimeswe can findI( ifh( ) is a function from Calc I)Butsometimes we can t and need a way to approximateI. MonteCarlo methods are one (of many) approaches to do (CMU) Importance SamplingReferencesTheLaw of Large NumbersWhilenothing is more uncertain than theduration of a single life, nothing is more certainthan the average duration of a thousand lives.
2 Elizur WrightFigure:Elizur Wright (1804 - 1885), American mathematician, the father oflife insurance , father of insurance regulation ( )JessiCisewski (CMU) Importance SamplingReferencesLaw of Large NumbersTheLaw of Large Numbersdescribes what happens when performing the sameexperiment many trials, theaverageof the results should be close to theexpected valueandwill be more accurate with more Carlo simulation, this means that we can learn properties of a randomvariable (mean, variance, etc.) simply by simulating it over many we want to estimate the probability,p, of a coin landing heads up . Howmany times should we flip the coin?JessiCisewski (CMU) Importance SamplingReferencesLaw of Large Numbers (LLN)Givenan independent and identically distributed sequence ofrandom variablesY1,Y2,..,Ynwith Yn=n 1 ni=1 YiandE(Yi) = , then for every >0P(| Yn |> ) 0,asn.
3 JessiCisewski (CMU) Importance SamplingReferencesMonteCarlo IntegrationGeneralideaMonteCarlo methods are a form of stochastic integration used toapproximate expectations by invoking the law of large bah(y)dy= baw(y)f(y)dy=Ef(w(Y))wheref(y) =1b aandw(y)=h(y) (b a)f(y)=1b aisthe pdf of a U(a,b) random variableBythe LLN, if we take an iid sample of sizeNfromU(a,b), wecan estimateIas I=N 1N i=1w(Yi) E(w(Y)) =IJessiCisewski (CMU) Importance SamplingReferencesMonteCarlo Integration: standard errorI= bah(y)dy= baw(y)f(y)dy=Ef(w(Y))MonteCarlo estimator: I=N 1 Ni=1w(Yi)Standard error of estimator: SE=s Nwheres2=(N 1) 1N i=1(w(Yi) I)2 JessiCisewski (CMU) Importance SamplingReferencesMonteCarlo Integration: Gaussian CDF example?Goal:estimateFY(y) =P(Y y) =E[I( ,y)(Y)]whereY N(0,1):F(Y y) = y 1 2 e t2/2dt= h(t)1 2 e t2/2dtwhereh(t)= 1 ift<yandh(t) = 0 ift yDraw an iid sampleY1.
4 ,YNfrom aN(0,1), then the estimatoris I=N 1N i=1h(Yi) =# draws<xN? of Wasserman (2004)JessiCisewski (CMU) Importance SamplingReferencesImportance Sampling : motivationStandard Monte Carlo integration is great if you can sample fromthetargetdistribution ( the desired distribution) But what if you can t sample from the target?Ideaof Importance Sampling : draw the sample from aproposaldistribution and re-weight the integral usingimportance weightssothat the correct distribution is targetedJessiCisewski (CMU) Importance SamplingReferencesMonteCarlo Integration Importance SamplingI= h(y)f(y)dyhissome function andfis the probability density function ofYWhenthe densityfis difficult to sample from, importancesampling can be usedRatherthan Sampling fromf, you specify a different probabilitydensity function,g, as the proposal h(y)f(y)dy= h(y)f(y)g(y)g(y)dy= h(y)f(y)g(y)g(y)dyJessiCisewski (CMU) Importance SamplingReferencesImportance SamplingI=Ef[h(Y)]= h(y)f(y)g(y)g(y)dy=Eg[h(Y)f(Y)g(Y)]Hence ,given an iid sampleY1.
5 ,YNfromg, our estimator ofIbecomes I=N 1N i=1h(Yi)f(Yi)g(Yi) Eg[h(Y)f(Y)g(Y)]=IJessiCisewski (CMU) Importance SamplingReferencesImportance Sampling : selecting the proposal distributionThestandard error of Icould be infinite ifg( ) is not selectedappropriately gshould have thicker tails thanf(don t wantratiof/gto get large)Eg[(h(Y)f(Y)g(Y))2]= (h(y)f(y)g(y))2g(y)dySelectagthat has a similar shape tof, but with thicker tailsVariance of Iis minimized wheng(y) |f(y)|Want to be able to sample fromg(y) with easeJessiCisewski (CMU) Importance SamplingReferencesImportance Sampling : IllustrationGoal:estimateP(Y< ) whereY fTry two proposal distributions: U(0,1) and U(0,4)JessiCisewski (CMU) Importance SamplingReferencesImportance Sampling : Illustration, 1000 samples of size 100, and find the IS estimates, we getthe followingestimatedexpected values and :U(0,1) :U(0,4) (CMU) Importance SamplingReferencesMonteCarlo Integration: Gaussian tail probability example?
6 Goal:estimateP(Y 3) whereY N(0,1) (Truth is )P(Y>3) = 31 2 e t2/2dt= h(t)1 2 e t2/2dtwhereh(t)= 1 ift>3 andh(t) = 0 ift 3 Draw an iid sampleY1,..,Y100from aN(0,1), then theestimator is I=1100100 i=1h(Yi)=# draws>3100? of Wasserman (2004)JessiCisewski (CMU) Importance SamplingReferencesGaussiantail probability example?, an iid sampleY1,..,Y100from aN(0,1), then theestimator is I=1100100 i=1h(Yi)Draw an iid sampleY1,..,Y100from aN(4,1), then theestimator is I=1100100 i=1h(Yi)f(Yi)g(Yi)wherefisthe density of a N(0,1) andgis the density of N(4,1)?Example of Wasserman (2004)JessiCisewski (CMU) Importance SamplingReferencesGaussiantail probability example?, of size 100, and find the MC and IS estimates,we get the followingestimatedexpected values and 105 Expected 10 5 Importance 10 8 JessiCisewski (CMU) Importance SamplingReferencesExtensionsof Importance SamplingSequentialImportance SamplingSequentialMonte Carlo (Particle Filtering) See Doucet et al.
7 (2001)Approximate Bayesian Computation See Turner and Zandt (2012)for a tutorial, and Cameron and Pettitt (2012); Weyant et al. (2013) forapplications to astronomyJessiCisewski (CMU) Importance SamplingReferencesBibliographyCameron,E. and Pettitt, A. N. (2012), Approximate Bayesian Computation for Astronomical Model Analysis: ACase Study in Galaxy Demographics and Morphological Transformation at High Redshift, Monthly Notices ofthe Royal Astronomical Society, 425, 44 , A., De Freitas, N., and Gordon, N. (2001),Sequential Monte Carlo Methods in Practice, Statistics forEngineering and Information Science, New York: , B. M. and Zandt, T. V. (2012), A tutorial on approximate Bayesian computation, Journal ofMathematical Psychology, 56, 69 , L. (2004),All of statistics: a concise course in statistical inference, , A., Schafer, C., and Wood-Vasey, W. M. (2013), Likeihood-free cosmological inference with type Iasupernovae: approximate Bayesian computation for a complete treatment of uncertainty, The AstrophysicalJournal, 764, (CMU) Importance Sampling