Inverse Transform Sampling 00 9 Qo 6 0 P 9 9.0 000 o。0 08 88o 00 00 0 oo 00 Gaussian distribution 0.9 Q.8 yi ® 03 02 0.2 0.1 sample xi sample xi 01 sample xi 90 5 0 10 5 (a).Gaussian CDF (b).Gaussian CDF with o2o (c).Gaussian CDF with o20
Gaussian distribution Inverse Transform Sampling
Inverse Transform Sampling >Sampling based on the inverse of Cumulative Distribution Function(CDF) >Method: CDF Sampling: Yi~Uniform(0,1) Xi=CDF-1(Yi) >Drawbacks: Usually,it's hard to get the inverse function
¾Sampling based on the inverse of Cumulative Distribution Function (CDF) ¾Method: ¾Drawbacks: • Usually, it’s hard to get the inverse function Inverse Transform Sampling
Example 1 8x ,if0≤x<0.25 f(x)= 8 8 3 ,if0.25≤x≤1 0 otherwise 8 0 ,ifx<0 422 ,if0≤x<0.25 F(x)= 3 x2- 3 3 ,if0.25≤x≤1 1 ifx>1 8 0.0 0.2 0.4 0.6 0.8 1.0 ,if0≤u<0.25 V31- ,if0.25≤u≤1 2
Example 1
Example 2 2m2 h(x)= (1-m2)z8, x∈m, '0 ,ifx<m )= sh()dt- m2 (1-m2)z2 ,ifx∈[m,1 ,ifx>1 my_invcdf samplepdf m2 H1(w=√1-(1-m2u 0.4 0.50.6 0.7 0.8 0.91.0 1.1 x,N=1000
Example 2
Rejection Sampling Ideas: Accept the samples in the region under the graph of its density function and reject others Rejection Sampling: Proposal distribution Q(x) Xi~Q(X) reject a~Uniform(0,Q(Xi)) Mq(x) if(a≤P(X) accept Accept p(x) else Reject x(i) Acceptance ratio =p(x)/Mg(x)
Ideas: • Accept the samples in the region under the graph of its density function and reject others Proposal distribution Q(x) Rejection Sampling Acceptance ratio = p(x)/Mq(x)