• Aucun résultat trouvé

On a Generalized Splitting Method for Sampling From a Conditional Distribution

N/A
N/A
Protected

Academic year: 2022

Partager "On a Generalized Splitting Method for Sampling From a Conditional Distribution"

Copied!
38
0
0

Texte intégral

(1)1. aft. On a Generalized Splitting Method for Sampling From a Conditional Distribution. Pierre L’Ecuyer Université de Montréal, Canada, and Inria–Rennes, France. Dr. Zdravko I. Botev The University of New South Wales, Sydney, Australia Dirk P. Kroese The University of Queensland, Brisbane, Australia. Winter Simulation Conference, Göteborg, December 2018.

(2) 2. aft. Sampling Conditional on a Rare Event Random vector Y in Rd , with density f . Suppose we know how to sample Y from f .. Dr. We want to sample it from f conditional on Y ∈ B, for some B ⊂ Rd for which p = P[Y ∈ B] is very small..

(3) 2. aft. Sampling Conditional on a Rare Event Random vector Y in Rd , with density f . Suppose we know how to sample Y from f . We want to sample it from f conditional on Y ∈ B, for some B ⊂ Rd for which p = P[Y ∈ B] is very small.. Dr. What for? It could be to estimate the conditional expectation E[h(Y) | Y ∈ B] for some real-valued cost function h, or to estimate E[h(Y)I(Y ∈ B)] or to estimate the conditional density, for example. There are many applications (CVaR, approximate zero-variance importance sampling, etc.). In Bayesian statistics, Y may represent a vector of parameters with given prior distribution and we may want to sample it from the posterior distribution given the data..

(4) 3. Algorithm 1: Standard rejection. aft. Rejection sampling. while true do Sample Y from its unconditional density f if Y ∈ B then return Y. Dr. To get an independent sample of size n, we can repeat n times independently. But if p = P[Y ∈ B] is very small, i.e., {Y ∈ B} is a rare event, this is too inefficient..

(5) 4. aft. Markov chain Monte Carlo (MCMC). Suppose we can construct an artificial Markov chain whose stationary distribution is the target one, i.e., the distribution of Y conditional on Y ∈ B.. Dr. We can start this Markov chain at some arbitrary state y0 ∈ B, run it for n0 + n steps for some large enough n0 , and retain the last n visited states as our sample..

(6) 4. aft. Markov chain Monte Carlo (MCMC). Suppose we can construct an artificial Markov chain whose stationary distribution is the target one, i.e., the distribution of Y conditional on Y ∈ B. We can start this Markov chain at some arbitrary state y0 ∈ B, run it for n0 + n steps for some large enough n0 , and retain the last n visited states as our sample.. Dr. But many issues arise. How large should be n0 ? Convergence to the stationary distribution may be very slow and the n retained states are typically highly dependent. Sometimes, we may also not know how to pick a valid state y0 from B..

(7) 5. Generalized splitting (GS). Dr. aft. Botev and Kroese (2012) proposed a generalized splitting approach as an alternative, to sample approximately from the conditional density. To apply GS, we need to choose:.

(8) 5. Generalized splitting (GS). aft. Botev and Kroese (2012) proposed a generalized splitting approach as an alternative, to sample approximately from the conditional density. To apply GS, we need to choose: 1. an importance function S for which {y : S(y) > γ ∗ } = B for some γ ∗ > 0, 2. an integer splitting factor s ≥ 2, and 3. a number τ > 0 of levels 0 = γ0 < γ1 < · · · < γτ = γ ∗ for which. Dr. P[S(Y) > γt | S(Y) > γt−1 ] ≈ 1/s,. for t = 1, . . . , τ − 1..

(9) 5. Generalized splitting (GS). aft. Botev and Kroese (2012) proposed a generalized splitting approach as an alternative, to sample approximately from the conditional density. To apply GS, we need to choose: 1. an importance function S for which {y : S(y) > γ ∗ } = B for some γ ∗ > 0, 2. an integer splitting factor s ≥ 2, and 3. a number τ > 0 of levels 0 = γ0 < γ1 < · · · < γτ = γ ∗ for which P[S(Y) > γt | S(Y) > γt−1 ] ≈ 1/s,. for t = 1, . . . , τ − 1.. Dr. 4. For each level t, an artificial Markov chain with transition density κt (y | x) and whose stationary density ft is the density of Y conditional on S(Y) > γt : ft (y) := f (y). I(S(y) > γt ) . P[S(Y) > γt ]. There are many ways of constructing these chains..

(10) 6. Algorithm 2: Generalized splitting. Dr. aft. Require: s, τ, γ1 , . . . , γτ Generate Y from its unconditional density f if S(Y) ≤ γ1 then return Yτ = ∅ and M = 0 // state Y does not reach first level; return empty list else Y1 ← {Y} // state Y has reached at least the first level for t = 2 to τ do Yt ← ∅ // list of states that have reached level γt for all Y ∈ Yt−1 do set Y0 = Y // we will simulate this chain for s steps for j = 1 to s do sample Yj from the density κt−1 (· | Yj−1 ) if S(Yj ) > γt then add Yj to Yt // this state has reached the next level return the list Yτ and its cardinality M = |Yτ |. // list of states that have reached B At each step, Yt is the set of states that have reached level t..

(11) 7. Dr. aft. Generalized Splitting.

(12) 8. aft. Choice of parameters. In many applications there is a natural choice for the importance function S. Good values for s, τ , and the levels {γt } can typically be found adaptively via an (independent) pilot experiment.. Dr. Based on our experience, taking s = 2 is usually best..

(13) 9. Some questions left partially open in the 2012 paper. Dr. aft. I Are the final states of the set of trajectories exactly or approximately distributed according according to the density f conditional on B? In empirical experiments with rare events, we observed that the empirical was very close to the conditional, and it was unclear if there was bias or not..

(14) 9. Some questions left partially open in the 2012 paper. aft. I Are the final states of the set of trajectories exactly or approximately distributed according according to the density f conditional on B? In empirical experiments with rare events, we observed that the empirical was very close to the conditional, and it was unclear if there was bias or not.. Dr. I Does GS provide an unbiased estimator of the conditional expectation of a function of Y , given Y ∈ B?.

(15) 9. Some questions left partially open in the 2012 paper. aft. I Are the final states of the set of trajectories exactly or approximately distributed according according to the density f conditional on B? In empirical experiments with rare events, we observed that the empirical was very close to the conditional, and it was unclear if there was bias or not. I Does GS provide an unbiased estimator of the conditional expectation of a function of Y , given Y ∈ B?. Dr. I Let M = |Yτ | be the number of particles that end up in B. If we pick at random one of those M terminal particles from a given run of GS, assuming that M > 1, is this particle distributed according to fτ (·) = f (· | Y ∈ B)?.

(16) 9. Some questions left partially open in the 2012 paper. aft. I Are the final states of the set of trajectories exactly or approximately distributed according according to the density f conditional on B? In empirical experiments with rare events, we observed that the empirical was very close to the conditional, and it was unclear if there was bias or not. I Does GS provide an unbiased estimator of the conditional expectation of a function of Y , given Y ∈ B?. Dr. I Let M = |Yτ | be the number of particles that end up in B. If we pick at random one of those M terminal particles from a given run of GS, assuming that M > 1, is this particle distributed according to fτ (·) = f (· | Y ∈ B)? I If we run GS r times, independently, and collect the terminal states of all the trajectories that have reached the rare event over the r runs, does their empirical distribution converge to the conditional distribution given B, and how fast?.

(17) 10. aft. Unbiasedness for each fixed potential branch. To study the previous questions, we will consider an imaginary version of the GS algorithm in which all s τ −1 potential trajectories are considered. For those that do not reach the next level in the GS algorithm, we assume that there are phantom trajectories that are continued at all levels. For t = 1, 2, . . . , τ , denote by Y t the corresponding set of s t−1 states at step t.. Dr. Let Y(1, j2 , . . . , jt ) ∈ Y t denote the state coming from the branch going through the j2 th state of step 2, j3 th state of step 3, . . . , and currently the jt th state at step t, where each ji ∈ {1, . . . , s}..

(18) 11. aft. Unbiasedness for each fixed potential branch The trajectories that are kept alive up to level t in the original algorithm are those for which the following event occurs: Et (1, j2 , . . . , jt ) := {Y(1) > γ1 , . . . , Y(1, j2 , . . . , jt ) > γt }.. Dr. Proposition 1. For any fixed level t and index (1, j2 , . . . , jt ), conditional on Et (1, j2 , . . . , jt ), the state Y(1, j2 , . . . , jt ) has density ft (exactly). For t = τ , this is the density of Y conditional on {Y ∈ B}. This can be proved by induction on t..

(19) 12. aft. Unbiasedness for expectation GS provides an unbiased estimator of E[h(Y)I(Y ∈ A)]:. Proposition 2. For any (measurable) function h and subset A ⊆ B, we have   X E s 1−τ h(Y)I(Y ∈ A) = E[h(Y)I(Y ∈ A)], Y∈Yτ. Dr. where the left expectation is with respect to Yτ and the one on the right is with respect to the original density f of Y..

(20) 12. aft. Unbiasedness for expectation GS provides an unbiased estimator of E[h(Y)I(Y ∈ A)]:. Proposition 2. For any (measurable) function h and subset A ⊆ B, we have   X E s 1−τ h(Y)I(Y ∈ A) = E[h(Y)I(Y ∈ A)], Y∈Yτ. Dr. where the left expectation is with respect to Yτ and the one on the right is with respect to the original density f of Y.. By taking A = B and h = 1 we find that E[M] = P(Y ∈ B)s τ −1 ..

(21) 13. aft. Sampling from the Conditional Density and Estimating the Conditional Expectation. Dr. Each run of the GS algorithm returns a sample Y1 , . . . , YM of random size M, taking values in B. In view of the previous unbiasedness results, one may expect that if we pick Y∗ at random uniformly from Y1 , . . . , YM , conditional on M ≥ 1 (if M = 0 we just retry), then this Y∗ will have the conditional density fτ (·) = f (· | Y ∈ B) and that h(Y∗ ) will be an unbiased estimator of the conditional expectation E[h(Y) | Y ∈ B]..

(22) 13. aft. Sampling from the Conditional Density and Estimating the Conditional Expectation. Dr. Each run of the GS algorithm returns a sample Y1 , . . . , YM of random size M, taking values in B. In view of the previous unbiasedness results, one may expect that if we pick Y∗ at random uniformly from Y1 , . . . , YM , conditional on M ≥ 1 (if M = 0 we just retry), then this Y∗ will have the conditional density fτ (·) = f (· | Y ∈ B) and that h(Y∗ ) will be an unbiased estimator of the conditional expectation E[h(Y) | Y ∈ B]. Unfortunately, this is not true.. The problem is that Y∗ and M are not independent!.

(23) 14. Formulation as a ratio of expectations. E[h(Y) | Y ∈ B] =. P. h(Y). We can write. aft. To see what goes on, let H =. Y∈Yτ. E[h(Y)I(Y ∈ B)]s τ −1 E[H] E[h(Y)I(Y ∈ B)] = = := ν, P[Y ∈ B] E[M] E[M]. which is a ratio of expectations.. Dr. For Y∗ picked uniformly from {Y1 , . . . , YM }, we have   X 1 E[h(Y∗ )] = E  h(Y∗ ) = E[H/M], M ∗ Y ∈Yτ. which is the expectation of a ratio..

(24) 14. Formulation as a ratio of expectations. E[h(Y) | Y ∈ B] =. P. h(Y). We can write. aft. To see what goes on, let H =. Y∈Yτ. E[h(Y)I(Y ∈ B)]s τ −1 E[H] E[h(Y)I(Y ∈ B)] = = := ν, P[Y ∈ B] E[M] E[M]. which is a ratio of expectations.. Dr. For Y∗ picked uniformly from {Y1 , . . . , YM }, we have   X 1 E[h(Y∗ )] = E  h(Y∗ ) = E[H/M], M ∗ Y ∈Yτ. which is the expectation of a ratio.. Special case: h(Y) = I(Y ∈ A) to stimate P(A), for any A ⊆ B..

(25) 15. aft. How to estimate ν consistently? We can estimate ν = E[h(Y) | Y ∈ B] via standard techniques for ratios of expectations. Classical approach:. 1. Simulate n independent replicates of the GS estimator, let Yτ,1 ,P . . . , Yτ,n be the n sets Yτ obtained from these realizations, and let Mi = |Yτ,i | and Hi = Y∈Yτ,i h(Y) be the realizations of M and H for replicate i, for i = 1, . . . , n. 2. Return the ratio estimator. H 1 + · · · + Hn . M1 + · · · + Mn. Dr. ν̂n =. This estimator is asymptotically normal and standard formulas are available to compute a confidence interval on ν. Can also use bootstrap..

(26) 16. Sampling from the Conditional Distribution. Dr. aft. To generate independent realizations of Y approximately from its conditional distribution given B, we can pick the realizations at random with replacement from Y∪ = Yτ,1 ∪ · · · ∪ Yτ,n . Let b n [A] = |Y∪ ∩ A|/|Y∪ | (empirical dist.); b n [A]]; Q Qn [A] = E[Q Q[·] = P[· | B] (true cond. dist.)..

(27) 16. Sampling from the Conditional Distribution. aft. To generate independent realizations of Y approximately from its conditional distribution given B, we can pick the realizations at random with replacement from Y∪ = Yτ,1 ∪ · · · ∪ Yτ,n . Let b n [A] = |Y∪ ∩ A|/|Y∪ | (empirical dist.); b n [A]]; Q Qn [A] = E[Q Q[·] = P[· | B] (true cond. dist.). b n converges to Q in the following large-deviation sense: The empirical distribution Q h i b n [A] − Q[A] > 2/p ≤ 4e −2n2 . Proposition 4. For any  ∈ (0, p/2], we have sup P Q A⊆B. Dr. b n [A] = H̄n (A)/M̄n . The proof uses Hoeffding’s inequality for numerator and denominator of Q.

(28) 16. Sampling from the Conditional Distribution. aft. To generate independent realizations of Y approximately from its conditional distribution given B, we can pick the realizations at random with replacement from Y∪ = Yτ,1 ∪ · · · ∪ Yτ,n . Let b n [A] = |Y∪ ∩ A|/|Y∪ | (empirical dist.); b n [A]]; Q Qn [A] = E[Q Q[·] = P[· | B] (true cond. dist.). b n converges to Q in the following large-deviation sense: The empirical distribution Q h i b n [A] − Q[A] > 2/p ≤ 4e −2n2 . Proposition 4. For any  ∈ (0, p/2], we have sup P Q A⊆B. Dr. b n [A] = H̄n (A)/M̄n . The proof uses Hoeffding’s inequality for numerator and denominator of Q b n ) to Q in total variation (proof in the paper). We also have convergence of Qn (but not of Q 2 Corollary 5. lim sup |Qn [A] − Q[A]| = n→∞ A⊆B p. Z. ∞. 4e. 0. −2n2. √ 2 2π √ d = → 0. p n.

(29) 17. A simple bivariate uniform (counter)example. aft. We illustrate the convergence behavior on a baby example, initially designed as a counter-example to show that the sampling is not exact. We have: I Y = (Y1 , Y2 ) uniform over [0, 1]2 , so f is the uniform density. I B = {y ∈ Y : S(y) > γ2 }. I S(y) = S(y1 , y2 ) = max(y1 , y2 ) I Number of levels τ = 2.. Dr. I Two splitting level cases: s = 2 and s = 10. √ √ I Level parameters γ1 = 1 − s −1 and γ2 = 1 − s −2 .. I The true conditional density on B is constant, equal to s 2 , for s = 2, 10. We want to compare the true conditional density with the density obtained from GS. We consider two choices of Markov chain kernel κt : Two-way and one-way resampling..

(30) 18. 1 γ2 γ1. aft. Bivariate Uniform Example. B2. B4 B5 B3. Dr. B1. 0. γ1. γ2. 1.

(31) 19. Two-way resampling. aft. Here we use a symmetric Gibbs sampling: always resample the two coordinates one after the other, in random order, conditional on S(Y) > γt−1 . Specifically, whenever Y1 is resampled, if Y2 > γt−1 we resample Y1 uniformly over (0, 1), otherwise we resample Y1 uniformly over (γt−1 , 1). And similarly for Y2 .. Dr. This produces a Markov chain trajectory over s steps, in the colored region. We retain the particles that fall in the set B = S(Y) > γ2 and they form the multiset Y2 . This GS procedure is repeated n times independently and the n realizations of Y2 (in case τ = 2) are merged in a single multiset Y∪ . We wish to compare the density of Qn with that of the true conditional density in each region Bi ⊂ B, i = 1, . . . , 5..

(32) 20. aft. Two-way resampling We replicate the following experiment r = 107 times, independently:. Dr. I Perform n independent runs of GS and construct the random multiset Y∪ . I If Y∪ is empty, this replicate has no contribution and we move to the next replicate. I Otherwise, we compute the proportion of states in Y∪ that fall in each of the five regions B1 , . . . , B5 , and divide each proportion by the area of the corresponding region, to obtain a conditional density given Y∪ . To estimate the exact densities d(B1 ), . . . , d(B5 ) over the five regions for the distribution of the retained state under in this setting, we simulated this process r times and averaged the conditional densities over the R0 replications for which Y∪ was nonempty. We did this with n = 1, 10, 100, 1000..

(33) 21. aft. Two-way resampling Density estimates in each region with r = 107 independent replicates, with n independent runs of GS per replicate, for s = 2 and 10. n 1 10 100 1000 1 10 100 1000. R0 3756298 9909982 10000000 10000000 651966 4902162 9987952 10000000. B1 3.98 3.994 4.000 4.000 99.8 100.0 100.0 100.0. B2 3.98 3.995 3.999 4.000 100.1 100.0 100.0 100.0. Dr. s 2 2 2 2 10 10 10 10. B3 4.06 4.016 4.001 4.000 101.2 99.8 100.0 100.0. B4 4.06 4.019 4.002 4.000 100.5 100.3 100.0 100.0. B5 4.05 4.017 4.001 4.000 99.2 100.0 100.0 99.9. Qn converges to Q very quickly with n and is already quite close even with n = 1..

(34) 22. aft. One-way resampling. Now we resample only the first coordinate Y1 conditional on S(Y) > γ1 . We do not resample Y2 . In this case, all points Y ∈ Yτ returned by GS on a given run have the same value of Y2 .. Dr. We repeated the same simulation experiment with this poor resampling scheme, still with r = 107 . Although the bias is now much larger, we still observe convergence to the uniform density when n increases and this convergence is slower when s is larger..

(35) 23. n 1 10 100 1000 1 10 100 1000. R0 3199391 9788291 10000000 10000000 385940 3251227 9803488 10000000. B1 4.82 4.30 4.022 4.002 170.5 167.8 140.8 104.3. B2 3.12 3.68 3.977 3.998 25.9 28.9 58.1 95.7. Dr. s 2 2 2 2 10 10 10 10. aft. Density estimates in each region, with r = 107 independent replicates and n independent runs of GS per replicate, for the one-way resampling, for s = 2 and 10. B3 5.84 4.67 4.049 4.005 254 244 166.7 105.2. B4 3.13 3.68 3.978 3.998 25.9 28.9 58.1 95.7. B5 3.13 3.68 3.978 3.998 26.4 29.2 57.9 95.6. The bias in Qn is now much larger than for the two-way case, and is larger for s = 10 than for s = 2. A larger s amplifies the bias because it creates more dependence. The density is higher in B1 and B3 ..

(36) 24. aft. Conclusions. Dr. I GS returns a random-sized sample of points such that unconditionally on the sample size, each point is distributed exactly according to the original distribution conditional on the rare event. I For any measurable cost function which is nonzero only when the rare event occurs, the method provides an unbiased estimator of the expected cost. I However, if we select at random one of the returned points, its distribution differs in general from the exact conditional distribution given the rare event. I But if we repeat the algorithm n times and select one of the returned points at random, the distribution of the selected point converges to the exact one in total variation. I The empirical distribution of the set of all points returned over all n replicates also converges to the conditional distribution given the rare event..

(37) 24. Some references. aft. Botev, Z. I., and D. P. Kroese. 2012. “Efficient Monte Carlo Simulation via the Generalized Splitting Method”. Statistics and Computing 22(1):1–16. Botev, Z. I., P. L’Ecuyer, G. Rubino, R. Simard, and B. Tuffin. 2013a. “Static Network Reliability Estimation Via Generalized Splitting”. INFORMS Journal on Computing 25(1):56–71.. Botev, Z. I., P. L’Ecuyer, and B. Tuffin. 2013b. “Markov Chain Importance Sampling with Application to Rare Event Probability Estimation”. Statistics and Computing 25(1):56–71.. Dr. Botev, Z. I., P. L’Ecuyer, and B. Tuffin. 2016. “Static Network Reliability Estimation under the Marshall-Olkin Copula”. ACM Transactions on Modeling and Computer Simulation 26(2):Article 14, 28 pages. Botev, Z. I., P. L’Ecuyer, and B. Tuffin. 2018. “Reliability Estimation for Networks with Minimal Flow Demand and Random Link Capacities”. Submitted, available at https://hal.inria.fr/hal-01745187. Choquet, D., P. L’Ecuyer, and C. Léger. 1999. “Bootstrap Confidence Intervals for Ratios of Expectations”. ACM Transactions on Modeling and Computer Simulation 9(4):326–348..

(38) Dr. aft. L’Ecuyer, P., F. LeGland, P. Lezaud, and B. Tuffin. 2009. “Splitting Techniques”. In Rare Event Simulation Using Monte Carlo Methods, edited by G. Rubino and B. Tuffin, 39–62. Chichester, U.K.: Wiley.. 24.

(39)

Références

Documents relatifs

, θ k mixture indicator variate is drawn from the multinomial distribution with k probabilities equal to the mixture weights.. Then, given the drawn mixture indicator value, k say,

« Qu’est ce que vous nous voulez !! » « Oh, rien de spécial » Tout à coup, une orbe de lumière noir se généra sans que je ne m’en rende compte.. L’agent fut propulsé

Schematic representation of the electron motion: (a) without density fluctu- ation, (b) with density fluctuation. Thus, the presence of small density fluctuations in strongly

If the most massive stars do contribute to the chemical enrichment only via their stellar winds, the expected ΔY/ΔO ratio is larger due to the high helium and low oxygen content of

As far as we know, Theorem 4.1 is the first consistency result for a method based on the original Breiman’s random forest algorithm (i.e. using the bootstrap samples).. The next

In the second case, no finite population size is assumed, but the gain from future patients is geometrically discounted, so that the gain from patient j if they receive treatment i is

For each assumed temperature of the hot gas, we use the R1 and R2 data (and thus the observed ratio) and the SWCX spectral shape to derive the respective contributions of SWCX and

Purpose: For nonlinear mixed-eects pharmacometric models, diagnostic approaches of- ten rely on individual parameters, also called empirical Bayes estimates (EBEs), esti- mated