Why Clip Density Ratios?
Under covariate shift, the source and target populations have different covariate distributions but share the same conditional distribution of the response given the covariates. A target risk can then be written as a source-population expectation weighted by a density ratio. If that ratio is large for some observations, a few weighted losses can strongly affect an empirical estimate. Clipping limits the size of each weight, but it also changes the expectation being estimated. A careful analysis must keep these two effects separate.
Let \(P_X\) and \(Q_X\) denote the source and target covariate distributions. Assume \(Q_X\) is absolutely continuous with respect to \(P_X\), and write \(w(x)=dQ_X/dP_X(x)\). Thus \(w\geq 0\) and \(E_P[w(X)]=1\). Assume the conditional distribution of \(Y\) given \(X\) is the same under source and target. For a fixed prediction rule, let \(L=\ell(f(X),Y)\) be its loss, with \(0\leq L\leq M\) almost surely for some finite \(M\). Expectations below are under the source distribution unless specified otherwise.
Because \(w_\tau\leq w\) and the loss is nonnegative, \(R_\tau\leq R\). The difference is a downward bias relative to the target risk, whereas the variance of \(\hat R_\tau\) describes its sampling variability around \(R_\tau\). These are distinct quantities.
Bias and Sampling Variance
The bias has an exact expression. It depends on the loss as well as on the tail of the ratio: large ratios create no bias at points where the loss is zero. A useful worst-case bound follows directly from \(L\leq M\).
To verify the identity, subtract the two expectations and use \(w-w_\tau=w-\min\{w,\tau\}=(w-\tau)_+\). Nonnegativity of \(L\) gives the lower bound, and \(L\leq M\) gives the upper bound. Thus clipping has a nonnegative downward bias, but its size is not determined by the maximum ratio alone.
For the empirical clipped risk, let \(Z_\tau=w_\tau(X)L\). Independence of the observations gives \(\operatorname{Var}(\hat R_\tau)=\operatorname{Var}(Z_\tau)/n\). Since \(0\leq Z_\tau\leq M\tau\), clipping bounds the contribution of every observation. This can be useful even when the unclipped weighted loss has a very large or infinite second moment. However, a bound on each contribution does not imply that the actual variance decreases as \(\tau\) decreases.
Worked Example: Clipping Can Increase the Actual Variance
Consider two covariate values, \(a\) and \(b\), with source probabilities \(P_X(a)=0.1\) and \(P_X(b)=0.9\). Let \(w(a)=5\) and \(w(b)=5/9\). These are valid density ratios because \(0.1(5)+0.9(5/9)=1\). Take losses \(L(a)=1/9\) and \(L(b)=1\), and clip at \(\tau=1\).
Without clipping, the weighted loss is \(5(1/9)=5/9\) at \(a\), and \((5/9)(1)=5/9\) at \(b\). It is constant, so its variance is zero and the target risk is \(R=5/9\).
After clipping, the weighted losses are \(1(1/9)=1/9\) at \(a\) and \(5/9\) at \(b\). Their mean is \(0.1(1/9)+0.9(5/9)=1/90+1/2=23/45\). The clipped variance is \(0.1(1/9-23/45)^2+0.9(5/9-23/45)^2=4/225\), which is positive. The clipped risk is \(23/45\), so its downward bias is \(5/9-23/45=2/45\).
This example verifies both effects: clipping introduces bias and, despite bounding the weights, increases the actual variance from zero to \(4/225\). It is therefore correct to say that clipping may reduce sampling variability or its upper bound, not that it always reduces actual variance.
Risk Bounds and Threshold Choice
For independent observations, the mean squared error around the target risk decomposes exactly into the variance around the clipped risk and the squared clipping bias:
Indeed, write \(\hat R_\tau-R=(\hat R_\tau-R_\tau)+(R_\tau-R)\), square, and take expectations. The cross-term vanishes because \(E[\hat R_\tau-R_\tau]=0\). This decomposition exposes the threshold trade-off: increasing \(\tau\) generally decreases the clipping bias, while the elementary upper bound on the weighted observations becomes larger. It does not assert that the actual variance changes monotonically.
For the variance term, \(\operatorname{Var}(Z_\tau)\leq E[Z_\tau^2]\leq M^2 E[\min(w,\tau)^2]\). Pointwise, \(\min(w,\tau)^2\leq \tau^{1-\delta}w^{1+\delta}\): if \(w\leq\tau\), this follows from \(w^{1-\delta}\leq\tau^{1-\delta}\); if \(w>\tau\), it follows from \(\tau^{1+\delta}\leq w^{1+\delta}\). Hence the variance divided by \(n\) is at most \(M^2 C\tau^{1-\delta}/n\).
For the bias, \((w-\tau)_+\leq w\,\mathbf{1}\{w>\tau\}\leq w^{1+\delta}/\tau^\delta\). The first inequality follows by considering separately \(w\leq\tau\) and \(w>\tau\); on the latter event, \(w\leq w^{1+\delta}/\tau^\delta\). Thus \(R-R_\tau\leq MC\tau^{-\delta}\), and its square is at most \(M^2C^2\tau^{-2\delta}\). Combining these bounds with the exact mean-squared-error decomposition proves the result. \(\square\)
Worked Example: A Finite-Moment Threshold
Suppose \(0\leq L\leq1\) and \(E_P[w(X)^{3/2}]\leq2\), so \(M=1\), \(C=2\), and \(\delta=1/2\). The theorem gives $$ E[(\hat R_\tau-R)^2]\leq \frac{2\tau^{1/2}}{n}+\frac{4}{\tau}. $$ The first term is the variance upper bound and grows with \(\tau\); the second is the squared-bias upper bound and decreases with \(\tau\).
Balancing the two terms gives \(2\tau^{1/2}/n=4/\tau\), hence \(\tau^{3/2}=2n\) and \(\tau=(2n)^{2/3}\). Substituting this threshold, the first term is \(2(2n)^{1/3}/n=2^{4/3}n^{-2/3}\), and the second is \(4/(2n)^{2/3}=2^{4/3}n^{-2/3}\). The resulting bound is \(2^{7/3}n^{-2/3}\). This calculation selects a threshold by balancing a valid upper bound; it does not claim that this threshold minimizes the unknown actual mean squared error.
When ratios are known to satisfy \(w\leq W\) almost surely, clipping at any \(\tau\geq W\) introduces no bias, since \((w-\tau)_+=0\). In that case the un-clipped weighted loss is bounded by \(MW\), and its variance is finite. A lower threshold may still be chosen for practical stability, but it sacrifices exact target-risk estimation and should be assessed through the bias expression.
Worked Example: Bounded Ratios and an Exact Bias Calculation
Let two covariate values have source probabilities \(1/2\) each, with ratios \(w(a)=1/2\) and \(w(b)=3/2\); their source mean is \(1\), and \(W=3/2\). Let the losses be \(L(a)=0.4\) and \(L(b)=0.8\). The target risk is \(R=(1/2)(1/2)(0.4)+(1/2)(3/2)(0.8)=0.1+0.6=0.7\).
At \(\tau=1\), the clipped weighted losses are \(0.2\) and \(0.8\), so \(R_\tau=(0.2+0.8)/2=0.5\). The exact bias is \(0.2\), matching \(E_P[(w-\tau)_+L]=(1/2)(1/2)(0.8)=0.2\). The unclipped weighted-loss variance is \(((0.2-0.7)^2+(1.2-0.7)^2)/2=0.25\); the clipped variance is \(((0.2-0.5)^2+(0.8-0.5)^2)/2=0.09\). Here clipping lowers the variance, but the preceding example shows why this outcome is not guaranteed.
Practical Interpretation and a Common Pitfall
Clipping is useful because it imposes a deterministic cap on each weighted loss, and under finite-moment assumptions it yields explicit bounds even when the un-clipped second moment is not controlled. Its cost is that the clipped expectation is generally not the target risk. In particular, clipping does not preserve \(E_P[w]=1\): typically \(E_P[w_\tau]<1\), so even a constant positive loss can have a lower clipped risk. Renormalizing the clipped weights would define a different estimator and require a separate bias analysis.
Common mistake: “Every observation has a smaller weight after clipping, so the sample variance must be smaller.” The premise only gives a pointwise comparison of weights, not a comparison of variances. Variance depends on both the size and the distribution of the weighted losses around their respective means. In the first worked example, the un-clipped weighted loss was constant, while clipping made it vary. The correction is to say that clipping bounds individual contributions and may reduce sampling variability or a variance bound; it does not guarantee a reduction in actual variance.
Check Your Understanding
Use the definitions and bounds above to answer the following questions.
- Why is the bias \(R-R_\tau\) nonnegative under the stated loss assumption, and what is its exact expression?
- If \(w\leq W\) almost surely, what happens to the clipping bias when \(\tau\geq W\)?
- Which two terms make up the mean squared error of \(\hat R_\tau\) around \(R\), and why does the cross-term vanish?
- Under a finite \((1+\delta)\)-moment bound, which term in the displayed risk bound decreases as \(\tau\) grows, and which term can increase?
- Why does bounding every clipped weighted loss fail to prove that clipping reduces the actual variance?