Importance sampling ⚖️

June 2023, reworked in 2026

Sampling refers to the generation of random variables following a certain probability distribution; for example if FF is a density on Rd\mathbb{R}^d, we want to generate random variables which are independent and follow the distribution given by FF, or we want to compute expectations like

EX∼F[φ(X)]=∫φ(x)F(x)dx\mathbb{E}_{X \sim F}[\varphi(X)] = \int \varphi(x)F(x)dx

for some function φ\varphi. In many cases, one does not fully knows FF, but only that it is proportional to some function ff, that is

F(x)=f(x)ZfwhereZf=∫f(u)du,F(x) = \frac{f(x)}{Z_f} \qquad \text{where} \qquad Z_f = \int f(u)du,

and computing the normalizing constant ZfZ_f is intractable.

There are many techniques that still allow to sample from FF in this case; the whole field of Monte-Carlo research consists in crafting stochastic systems (Markov Chains, diffusions) that converge toward samples from FF. In this note I'm focusing on a simpler method, importance sampling (IS), also called reweighting, which allows to compute integrals like above, without sampling from FF.

Plan of the note.

The basic idea of Importance Sampling

Let GG be another probability density, supposed easy to sample from. Throughout, F,GF,G denote the normalized densities and f,gf,g their unnormalized versions, so that F=f/ZfF = f/Z_f and G=g/ZgG = g/Z_g. We will never use the exact values of ZfZ_f or ZgZ_g.

In the sequel, we will adopt the following notations.

  • Samples from FF are noted XX or XiX_i. The density FF is called the target.

  • Samples from GG are noted YY or YiY_i. The density GG is called the proposal.

  • The ratio of unnormalized densities will be denoted by w(x)=f(x)/g(x)w(x) = f(x)/g(x).

  • The ratio of the densities will be denoted by W(x)=F(x)/G(x)W(x) = F(x)/G(x).

Then, for any function φ\varphi,

E[φ(Y)w(Y)]=∫φ(y)f(y)g(y)G(y)dy=1Zg∫φ(y)f(y)dy=ZfZgE[φ(X)].\begin{aligned} \mathbb{E}[\varphi(Y)w(Y)] &= \int \varphi(y)\frac{f(y)}{g(y)}G(y)dy \\ &= \frac{1}{Z_g}\int \varphi(y)f(y)dy \\ &= \frac{Z_f}{Z_g} \mathbb{E}[\varphi(X)]. \end{aligned}

Applying this formula to φ≡1\varphi \equiv 1 yields E[w(Y)]=Zf/Zg\mathbb{E}[w(Y)] =Z_f/Z_g. Consequently,

E[φ(Y)w(Y)]E[w(Y)]=E[φ(X)].\frac{ \mathbb{E}[\varphi(Y)w(Y)] }{ \mathbb{E}[w(Y)] } = \mathbb{E}[\varphi(X)].

This suggests the following method for approximating E[φ(X)]\mathbb{E}[\varphi(X)] without computing ZfZ_f or ZgZ_g.

Importance Sampling. Let Y1,…,YnY_1, \dotsc, Y_n be iid with density GG. Then, when n→∞n\to\infty, almost surely one has ∑i=1nw(Yi)n→ZfZg \frac{\sum_{i=1}^n w(Y_i)}{n} \to \frac{Z_f}{Z_g} and 1n∑i=1nw(Yi)φ(Yi)1n∑i=1nw(Yi)→E[φ(X)]=∫φ(x)F(x)dx. \frac{\frac{1}{n}\sum_{i=1}^n w(Y_i) \varphi(Y_i)}{\frac{1}{n}\sum_{i=1}^n w(Y_i)} \to \mathbb{E}[\varphi(X)]= \int \varphi(x)F(x)dx.

Proof. By the Law of Large Numbers, the LHS of (5) converges towards E[w(Y)]=∫w(y)G(y)dy=Zf/Zg\mathbb{E}[w(Y)] = \int w(y)G(y)dy = Z_f/Z_g.

Also by the LLN, ∑i=1nw(Yi)φ(Yi)n\frac{\sum _{i=1}^n w(Y_i)\varphi(Y_i)}{n} converges towards E[φ(Y)w(Y)]=(Zf/Zg)E[φ(X)]\mathbb{E}[\varphi(Y)w(Y)] = (Z_f/Z_g)\mathbb{E}[\varphi(X)].

Take the ratio of the two to get (6).

How good is this approximation?

Unless FF and GG are already very close to each other, this estimator can be very bad. Let's look at the variance of the estimator Z^\hat{Z} given in (5): clearly E[Z^]=Zf/Zg\mathbb{E}[\hat{Z}]=Z_f/Z_g, hence

Var(Z^)=∫Gf2g2−(Zf/Zg)2n=∫gZgf2g2−(Zf/Zg)2n=(Zf/Zg)E[w(X)]−(Zf/Zg)2n.\begin{aligned} \mathrm{Var}(\hat{Z}) &= \frac{\int G\frac{f^2}{g^2} - (Z_f/Z_g)^2}{n} \\ &= \frac{\int \frac{g}{Z_g} \frac{f^2}{g^2} - (Z_f/Z_g)^2}{n} \\ &= \frac{(Z_f/Z_g)\mathbb{E}[w(X)]-(Z_f/Z_g)^2}{n}. \end{aligned}

The first term, especially E[w(X)]\mathbb{E}[w(X)], could be prohibitively big. Indeed, let us consider the following situation: our prior density is a Standard Gaussian G(x)=e−x2/2/2πG(x) = e^{-x^2/2}/\sqrt{2\pi}, and our target density is the same, but shifted by 10: F(x)=e−(x−10)2/2/2πF(x) = e^{-(x-10)^2/2}/\sqrt{2\pi}. Here both densities are normalized, so Zf=Zg=1Z_f=Z_g=1 and f=Ff=F, g=Gg=G. But,

E[F(X)/G(X)]=12π∫e−(x−10)22e−(x−10)22+x22dx=12π∫e−(x−20)22+100dx=e100.\begin{aligned}\mathbb{E}[F(X)/G(X)] &= \frac{1}{\sqrt{2\pi}}\int e^{-\frac{(x-10)^2}{2}}e^{-\frac{(x-10)^2 }{ 2} + \frac{x^2}{2}}dx\\ &= \frac{1}{\sqrt{2\pi}}\int e^{- \frac{(x-20)^2}{2} + 100}dx \\&= e^{100}.\end{aligned}

That is too big. Having a low variance for Z^\hat{Z} would require having more than e100e^{100} samples, which is impossible. And indeed, one can even find simple examples (exponential distributions) for which the variance is infinite.

The Effective Sample Size

The ESS. Let us note wˉi\bar{w}_i the normalized weights,

wˉi=w(yi)∑i=1nw(Yi).\bar{w}_i = \frac{w(y_i)}{\sum_{i=1}^n w(Y_i)}.

The SNIS estimation of ∫φF\int \varphi F is

Jn=∑wˉiφ(Yi).J_n = \sum \bar{w}_i \varphi(Y_i).

Suppose for a moment that you are in the ideal case where your proposal distribution GG is equal to FF, and you have mm samples YiY_i. Then, all the weights w(Yi)w(Y_i) are equal to 1 and thus wˉi=1/m\bar{w}_i = 1/m. The variance of Jm{J}_m in this case is simply

σ2m\frac{\sigma^2}{m}

where σ2=Var(φ(Y))\sigma^2 = \mathrm{Var}(\varphi(Y)). Now go back to the case where you have nn samples YiY_i (I'll call them "fake samples") from a proposal distribution GG. Forget an instant that the wˉi\bar{w}_i are random, and treat them like fixed weights. Yes, I know they're not, but imagine. Then the variance of JnJ_n should be

∑i=1wˉi2Var(φ(Y))=∣wˉ∣22σ2.\sum_{i=1}\bar{w}_i^2 \mathrm{Var}(\varphi(Y)) = |\bar{w}|_2^2 \sigma^2.

This is actually a good approximation of the variance of JnJ_n, as explained in the litterature (e.g. in Kong's seminal paper or in Liu's paper).

Given these two approximations, what is the number of "real" samples from FF that would give the same variance as nn "fake" samples? Just solve (11) = (12) and you get the Effective Sample Size,

n∗=1∑i=1nwˉi2.n_* = \frac{1}{\sum_{i=1}^n \bar{w}_i^2}.

Other equivalent forms are sometimes seen in the litterature, e.g. in Kong's seminal paper[1], with more rigorous derivations (they consist in using the "delta-method" to estimate Var(Jn)\mathrm{Var}(J_n) and are not especially enlightening).

An ESS of n∗=100n_*=100 with a sample size of 1000 says that your 1000 "fake samples" will get you the same precision as 100 "real samples". Ultimately, if one real sample from FF costs 1€, then the real price of your nn fake samples would be n∗n_*€. And we always have n∗⩽nn_* \leqslant n, of course.

Generalized ESS. In general, if you have a decent "precision metric" to evaluate an estimator, you can compute a generalized notion of sample size: just compute the metric on your nn samples, and then compute the number mm of real samples which would give the same metric.

In practice, the ESS is not really used to assess the quality of an estimator, but rather to take decisions on when to resample or not. It is often used in sequential settings, where one can monitor the ESS along time and decide to resample the proposals when the ESS collapses.

However, Empirical Sample Sizes often do not tell the whole story, and are not very informative on the precision of an estimator, but rather on the relative precision compared to other estimators. Concretely, they do not tell you if your nn samples are really enough to estimate ∫φF\int \varphi F.

The number of samples required for IS

For any function φ\varphi, we will denote by

Jn(φ)=∑i=1nw(Yi)φ(Yi)∑i=1nw(Yi)J_n(\varphi) = \frac{\sum_{i=1}^n w(Y_i)\varphi(Y_i)}{\sum_{i=1}^n w(Y_i)}

the IS estimator of the target integral ∫Fφ\int F\varphi, which will be noted I(φ)I(\varphi).

Note that JnJ_n is unchanged if the weights w=f/gw=f/g are replaced by the normalized likelihood ratio W=F/GW = F/G; in the sequel of this section we work with WW, for which E[W(Y)]=1\mathbb{E}[W(Y)]=1.

The Informational sample size

The Kullback-Leibler divergence from FF towards GG is

D=dKL(F∣G)=∫Flog⁡(F/G).D = d_{\mathrm{KL}}(F\mid G) = \int F \log (F/G).

It is supposed to be <∞<\infty. It can also be defined as D=E[log⁡W(X)]D=\mathbb{E}[\log W(X)]. In general, concentration inequalities allow to bound how much log⁡W(X)\log W(X) is concentrated around its mean DD: depending on F,GF,G, the deviation probability

ϵ(s)=P(∣log⁡W(X)−D∣>s)\epsilon(s)=\mathbb{P}(|\log W(X) - D| > s)

is a decreasing function of ss with ϵ(s)→0\epsilon(s)\to 0. The error terms in the sequel will be expressed using this function ϵ\epsilon. For any positive ss we note

ε(s)=(e−s/4+2ϵ(s/2))1/2\varepsilon(s) = (e^{-s/4} + 2\sqrt{\epsilon(s/2)})^{1/2}

and finally we also note ∣φ∣22=∫φ(x)2F(x)dx|\varphi|^2_2 = \int \varphi(x)^2 F(x)dx the L2-norm relatively to the target FF.

Theorem (Chatterjee and Diaconis, 2015).

Positive part. Suppose that n=eD+sn=e^{D+s}.

Then, for any φ\varphi which is in L2(F)L^2(F), P(∣Jn(φ)−E[φ(X)]∣>4ε(s)∣φ∣2)⩽2ε(s).\mathbb{P}(|J_n(\varphi) - \mathbb{E}[\varphi(X)]|>4\varepsilon(s) |\varphi|_2)\leqslant 2\varepsilon(s). Negative part. Conversely, suppose that n=eD−sn=e^{D-s}.

We note D^n\hat{D}_n the IS estimator of the Kullback-Leibler divergence DD. Then this estimator is bad, in the sense that D^n⩽D−s\hat{D}_n \leqslant D - s with a fixed positive probability, at least greater than 1−P(log⁡W(X)>D−s)1-\mathbb{P}(\log W(X) > D-s).

To summarize: if one has more than eDe^{D} samples, then for every fixed φ\varphi the probability of having Jn(φ)J_n(\varphi) close to I(φ)I(\varphi) is high. But if nn is smaller than eDe^D, then there might be functions such that with high probability, the estimator Jn(φ)J_n(\varphi) is far away from I(φ)I(\varphi). The original proof in the Chatterjee-Diaconis paper shows that the function φ(x)=1W(x)<λ\varphi(x) = \mathbb{1}_{W(x)<\lambda} is itself hard to approximate, for some λ\lambda. That the KL itself is hard to estimate is due to El Houssain Chahboun, a PhD student under the supervision of Pierre Jacob. The proof is entirely due to him!

Uniform bounds. Note that for a specific φ\varphi, it might very well be true that less than eDe^D samples are needed. But eDe^D is always enough. This asks for a natural question: how many samples do you need so that every estimator of every φ\varphi is simultaneously good? That is, could we control

sup⁡φ∈F∣Jn(φ)−I(φ)∣\sup_{\varphi \in \mathscr{F}}\left|J_n(\varphi) - I(\varphi)\right|

over a certain class F\mathscr{F}?

The Wasserstein sample size

If F\mathscr{F} is the set of all 1-Lipschitz functions, it turns out that this supremum is nothing more than the Wasserstein-1 distance between the target density FF and the « empirical self-normalized weighted measure », namely

F^n=∑i=1nwˉiδYi\hat{F}_n = \sum_{i=1}^n \bar{w}_i\delta_{Y_i}

where wˉi=w(Yi)/(w(Y1)+⋯+w(Yn))\bar{w}_i = w(Y_i) / (w(Y_1)+\dotsb + w(Y_n)) are the self-normalized weights. In a recent work with Michael Goldmann, we computed the asymptotics of W1(F,F^n)W_1(F, \hat{F}_n) as nn is large[2].

Wasserstein asymptotics. For F,GF,G compactly supported and bounded away from zero and ∞\infty, we have

E[Wpp(F^n,F)]≍n−p/d∫FG−p/d.\mathbb{E}[W_p^p(\hat{F}_n,F)]\asymp n^{-p/d}\int F G^{-p/d}.

Consequence on the sample size. Using this asymptotic, a good proxy for Chatterjee and Diaconis’ study would be that, to have a good approximation, we would need a number nn of samples at least comparable to cdc^d, where c=∫FG−p/dc = \int F G^{-p/d}. If dd is large, we can work further our approximation:

cd=(∫Fe−1dlog⁡G)d≈(∫F(1−d−1log⁡G))d≈(1−1d∫Flog⁡G)d≈e−∫Flog⁡G.\begin{aligned} c^d &= \left(\int F e^{-\frac{1}{d}\log G}\right)^d \\ &\approx \left(\int F(1 - d^{-1}\log G)\right)^d \\ &\approx\left(1 - \frac{1}{d}\int F \log G\right)^d \\ &\approx e^{-\int F \log G}. \end{aligned}

The entropy of FF is E=−∫Flog⁡FE = -\int F \log F; therefore, the term above is also equal to exp⁡(D−∫Flog⁡F)=exp⁡(D+E)\exp(D - \int F\log F)= \exp(D+E), which is not the eDe^D of Chatterjee-Diaconis. What happens here is not 100% clear for me, but here is my take:

Diagnoses

As explained in the ESS section, a prominent question in the theory of IS is: how can we craft diagnostic metrics of an estimator, that indicate whether the estimator is good or bad?

A priori, the two results given above could give an answer: we have to check if nn is greater than, for example, eDe^D. We do not know DD but we could still estimate it using IS, with

D^n=∑w(Yi)log⁡w(Yi)∑w(Yi)−log⁡Z^n.\hat{D}_n = \frac{\sum w(Y_i)\log w(Y_i)}{\sum w(Y_i)} - \log \hat{Z}_n.

Then declare your IS estimator to be good is n>eD^nn > e^{\hat{D}_n}.

This is dommed to fail. As Chatterjee and Diaconis explain, "any diagnostic criterion that is itself dependent on the accuracy of an estimate obtained by importance sampling, is unlikely to be effective as a measure of the efficacy of importance sampling". Id est, the second point of the theorem tells you that estimating DD with (23) is already a bad idea, so don't use it to estimate if nn is large enough.

That's the point of the ESS: it is self-contained, in that you only need the weights w(yi)w(y_i) to compute the diagnostic criterion. But the ESS itself is a weak criterion, in that there is no connection between the variance of ww and eDe^D. This is why Chatterjee and Diaconis favor another criterion, which is simply the L∞/L1L^\infty / L^1 ratio,

Qn=max⁡w(yi)∑w(yi).Q_n = \frac{\max w(y_i)}{\sum w(y_i)}.

They have convincing but incomplete heuristics on this diagnostic quantity. I will, at some point, expose them here.

Proof of the Chatterjee-Diaconis sample size

The proof relies on the following lemma, in which we have set

In(φ)=∑i=1nφ(Yi)W(Yi)n.I_n(\varphi)= \frac{\sum_{i=1}^n \varphi(Y_i)W(Y_i)}{n}.
Lemma. For any λ>0\lambda >0, E[∣In(φ)−I(φ)∣]⩽∣φ∣2(λn+2P(W(X)>λ)).\mathbb{E}[|I_n(\varphi) - I(\varphi)|] \leqslant |\varphi|_{2}\left(\sqrt{\frac{\lambda}{n}} + 2\mathbb{P}(W(X)>\lambda)\right).

As noted earlier we have E[log⁡W(X)]=D\mathbb{E}[\log W(X)] = D, hence it is natural to choose log⁡λ\log \lambda at the same scale as DD. We take λ=eD+s/4\lambda = e^{D + s/4}. The ratio λ/n\lambda/n becomes e−s/4e^{-s/4} and P(W(X)>λ)⩽ϵ(s/4)\mathbb{P}(W(X)>\lambda)\leqslant \epsilon(s/4). Overall, the RHS of becomes equal to ∣φ∣2×ε(s)2 |\varphi|_2 \times \varepsilon(s)^2 .

We will prove this lemma later. From now on, let us prove the theorem.

Proof of the positive part. If ∣In(1)−1∣<δ|I_n(1)-1|<\delta and ∣In(φ)−I(φ)∣<δ′|I_n(\varphi) - I(\varphi)|<\delta' then we see that ∣Jn(φ)−I(φ)∣=∣In(φ)/In(1)−I(φ)∣⩽∣In(φ)−I(φ)∣+∣I(φ)∣∣In(1)−1∣∣In(1)∣⩽δ′+δ∣I(φ)∣1−δ\begin{aligned}|J_n(\varphi) - I(\varphi)| &= |I_n(\varphi)/I_n(1) - I(\varphi)|\\&\leqslant \frac{|I_n(\varphi) - I(\varphi)| + |I(\varphi)||I_n(1)-1|}{|I_n(1)|} \\ &\leqslant \frac{\delta' + \delta |I(\varphi)|}{1-\delta} \end{aligned} Now choose δ=ε(s)\delta = \varepsilon(s) and δ′=∣φ∣2ε(s)\delta' = |\varphi|_2 \varepsilon(s). Moreover, since ∣I(φ)∣⩽∣φ∣2|I(\varphi)|\leqslant |\varphi|_2 by the Cauchy-Schwarz inequality, we get that

δ′+δ∣I(φ)∣1−δ⩽2ε(s)∣φ∣21−ε(s).\frac{\delta' + \delta |I(\varphi)|}{1-\delta}\leqslant \frac{2\varepsilon(s)|\varphi|_2}{1 - \varepsilon(s)}.

In particular, if ε(s)<1/2\varepsilon(s)<1/2, then

P(∣Jn(φ)−I(φ)∣>4∣φ∣2ε(s))⩽P(∣In(1)−1∣>δ or ∣In(φ)−I(φ)∣>δ′).\mathbb{P}(|J_n(\varphi) - I(\varphi)| > 4|\varphi|_2\varepsilon(s) )\leqslant \mathbb{P}(|I_n(1)-1|>\delta \text{ or } |I_n(\varphi) - I(\varphi)|>\delta').

We use the union bound and bound the probability of each event separately; to do that we apply Markov's inequality and the Lemma to the constant function 11 and to the function φ\varphi. We get P(∣In(1)−1∣>δ)⩽ε(s)2/δ=ε(s),P(∣In(φ)−I(φ)∣>δ′)⩽∣φ∣2ε(s)2/δ′=ε(s).\begin{aligned} &\mathbb{P}(|I_n(1) - 1|>\delta) \leqslant \varepsilon(s)^2/\delta = \varepsilon(s), \\ &\mathbb{P}(|I_n(\varphi) - I(\varphi)|>\delta') \leqslant |\varphi|_2 \varepsilon(s)^2/\delta' = \varepsilon(s).\end{aligned} Hence by the union bound the probability is at most 2ε(s)2\varepsilon(s), which is the claim.

Proof of the negative part. A small remark to begin: we note

wi=W(Yi)∑j=1nW(Yj)w_i = \frac{W(Y_i) }{\sum_{j=1}^n W(Y_j)}

for the normalized importance weights. They are positive and sum to 1. Consequently, for any numbers tit_i, if ∑witi\sum w_i t_i is greater than TT then at least one of the tit_i is greater than TT.

When trying to estimate the KL with importance sampling, we set

D^n=∑i=1nwilog⁡W(Yi)\hat{D}_n = \sum_{i=1}^n w_i \log W(Y_i)

where W=F/GW = F/G. Then, by the remark above, P(D^n>D−s)⩽P(∃i:log⁡W(Yi)>D−s)⩽nP(log⁡W(Y)>D−s).\begin{aligned}\mathbb{P}(\hat{D}_n > D-s)&\leqslant \mathbb{P}(\exists i : \log W(Y_i) > D-s)\\ &\leqslant n\mathbb{P}(\log W(Y) > D-s). \end{aligned} Now we bound this probability using Markov’s inequality. We have P(log⁡W(Y)>D−s)=∫W(y)>eD−sG(y) dy⩽e−D+s∫W(y)>eD−sW(y) G(y) dy=e−D+sP(log⁡W(X)>D−s).\begin{aligned} \mathbb{P}(\log W(Y) > D-s) &= \int_{W(y)>e^{D-s}} G(y)\, dy\\ &\leqslant e^{-D+s}\int_{W(y)>e^{D-s}} W(y)\, G(y)\, dy \\ &= e^{-D+s}\mathbb{P}(\log W(X)>D-s). \end{aligned} To summarize, if n=eD−sn=e^{D-s} we showed that

P(D^n>D−s)⩽P(log⁡W(X)>D−s),\mathbb{P}(\hat{D}_n > D - s)\leqslant \mathbb{P}(\log W(X) > D-s),

hence D^n⩽D−s\hat{D}_n \leqslant D-s with probability at least 1−P(log⁡W(X)>D−s)1-\mathbb{P}(\log W(X) > D-s).

Proof of the Lemma

Set ψ=φ1W⩽λ\psi = \varphi \mathbb{1}_{W\leqslant \lambda}. Then,

∣In(φ)−I(φ)∣⩽∣In(φ)−In(ψ)∣+∣In(ψ)−I(ψ)∣+∣I(ψ)−I(φ)∣=A+B+C |I_n(\varphi) - I(\varphi) |\leqslant | I_n(\varphi) - I_n(\psi) |+| I_n(\psi) - I(\psi)| + |I(\psi) - I(\varphi)| = A+B+C

– Term CC is equal to ∫F(x)φ(x)1W(x)>λdx\int F(x)\varphi(x)\mathbb{1}_{W(x)> \lambda}dx. By the Cauchy-Schwarz inequality it is smaller than

∫φ(x)2F(x)dx×P(W(X)>λ)=∣φ∣2P(W(X)>λ). \sqrt{\int \varphi(x)^2 F(x)dx \times \mathbb{P}(W(X)> \lambda)} = |\varphi|_{2}\sqrt{\mathbb{P}(W(X)> \lambda)}.

– Term BB is smaller than 1n∑W(Yi)∣φ(Yi)∣1W(Yi)>λ \frac{1}{n}\sum W(Y_i)|\varphi(Y_i)| \mathbb{1}_{W(Y_i)>\lambda} hence its expectation is smaller than E[W(Y)∣φ(Y)∣1W(Y)>λ]=E[φ(X)1W(X)>λ]\mathbb{E}[W(Y)|\varphi(Y)|\mathbb{1}_{W(Y)>\lambda}] = \mathbb{E}[\varphi(X)\mathbb{1}_{W(X)>\lambda}] and we use the same trick as (37).

– Term AA is bounded as follows:

E[∣In(ψ)−I(ψ)∣]⩽E[∣In(ψ)−I(ψ)∣2]=Var(In(ψ))⩽∫ψ(y)2W(y)2G(y)dyn⩽∫W(y)⩽λφ(y)2W(y)F(y)dyn⩽λ∫φ(y)2F(y)dyn=λ∣φ∣22/n.\begin{aligned} \mathbb{E}[|I_n(\psi) - I(\psi)|]&\leqslant \sqrt{\mathbb{E}[|I_n(\psi) - I(\psi)|^2]} = \sqrt{\mathrm{Var}(I_n(\psi))}\\ &\leqslant\sqrt{\frac{\int \psi(y)^2W(y)^2G(y)dy}{n} }\\ &\leqslant \sqrt{ \frac{\int_{W(y)\leqslant \lambda} \varphi(y)^2 W(y) F(y) dy}{n}}\\ &\leqslant \sqrt{\lambda \frac{\int \varphi(y)^2 F(y) dy}{n} } = \sqrt{\lambda |\varphi|^2_{2}/n}.\\ \end{aligned}

We gather the three bounds and get (26).

Reference

[2]  actually we computed the asymptotics for every p⩾1p\geqslant 1.
[1] Typically the equivalent expressions are n1+σ2\frac{n}{1+\sigma^2} where σ2\sigma^2 is the variance of W(x)=F(x)/G(x)W(x) = F(x)/G(x) under GG. Since EGW=1\mathbb{E}_GW = 1, we see that σ2=EG[W2]−1\sigma^2 = \mathbb{E}_G [W^2] - 1, and thus Kong's ESS is n/EG[W2]n/\mathbb{E}_G[W^2]. But we can estimate

EG[W2]≈1n∑w(Yi)2(1n∑w(Yi))2=n∑wˉi2\mathbb{E}_G[W^2]\approx \frac{\frac{1}{n}\sum w(Y_i)^2}{\left(\frac{1}{n}\sum w(Y_i)\right)^2} = n \sum \bar{w}_i^2

and thus

ESS≈1∑wˉi2.ESS \approx \frac{1}{\sum \bar{w}_i^2.}

Hence the equivalence between the two expressions.