Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Kernel Density Estimation From Left-Truncated Losses

Exam ASTAM · Kernel, Truncation, and Censoring · Tutorial 286 of 979

Kernel Density Estimation From Left-Truncated Losses

Learn how observation probabilities change a kernel density estimate and how to calculate and interpret the inverse-probability adjustment.

Advanced 11 min read

What You'll Learn

  • Derive the observed loss density under independent left truncation
  • Calculate inverse observation-probability weights from a truncation mechanism
  • Construct and normalize a weighted kernel density estimate
  • Compare weighted and naive estimates at specified loss values
  • Identify when zero observation probability prevents recovery of the population density
  • Avoid confusing inverse-probability weights with observation probabilities

Why Truncation Changes a Density Estimate

A kernel density estimate smooths observed loss values to describe a loss distribution. With left truncation, however, a loss enters the data only when it exceeds its associated threshold. Small losses can therefore be less likely to appear than large losses. Smoothing the observed values without adjustment estimates the distribution among selected records, not generally the loss distribution in the population from which those records arose.

The adjustment in this tutorial uses the probability that a loss value would be observed. Each recorded loss receives a weight inversely proportional to that probability: losses that are harder to observe receive more weight. This corrects selection bias only where observation is possible and the selection probabilities are known or can be estimated appropriately.

Definition: Let \(X\) be a loss and \(T\) its left-truncation threshold. A record is observed when \(T<X\). Assume \(T\) and \(X\) are independent, and define the observation probability \(\pi(x)=P(T<x)\). If \(f_X(x)\) is the population density of \(X\), then the density among observed losses is \(f_{\mathrm{obs}}(x)=f_X(x)\pi(x)/c\), where \(c=P(T<X)\) is the overall probability of selection. The inverse-probability weight for an observed value \(x\) is \(w(x)=1/\pi(x)\).

The independence assumption makes the observation probability a function of the loss value through the threshold distribution. If truncation depends on additional variables, the appropriate observation probability must condition on those variables as well; using a marginal \(\pi(x)\) without justification can leave selection bias. The threshold mechanism must also provide positive observation probability wherever the population density is to be estimated.

Weighted Kernel Density Estimation

Choose a kernel function \(K\) and bandwidth \(h>0\). A kernel is a nonnegative function that integrates to one; \(K(u)\) assigns smoothing weight to a loss at standardized distance \(u\) from the point being estimated. For observed losses \(x_1,\ldots,x_n\), the ordinary, or naive, kernel estimate is

$$ \widehat f_{\mathrm{naive}}(x) =\frac{1}{nh}\sum_{i=1}^{n}K\!\left(\frac{x-x_i}{h}\right). $$

Under left truncation, use weights \(w_i=1/\pi(x_i)\), and normalize by their sum:

$$ \widehat f_{\mathrm{IPW}}(x) = \frac{\displaystyle\sum_{i=1}^{n}w_i\,K\!\left(\frac{x-x_i}{h}\right)} {\displaystyle h\sum_{i=1}^{n}w_i}. $$

The normalization is essential. In general, the weights do not sum to \(n\); dividing by \(nh\) after weighting does not produce the normalized weighted estimate. Multiplying every weight by the same positive constant does not change this ratio, but replacing \(1/\pi(x_i)\) with \(\pi(x_i)\) does.

Derivation: For any suitable function \(g\), conditioning on selection gives \[ E\!\left[\frac{g(X)}{\pi(X)}\ \middle|\ T<X\right] =\frac{1}{c}\int \frac{g(x)}{\pi(x)}f_X(x)\pi(x)\,dx =\frac{E[g(X)]}{c}. \] Taking \(g(x)=K((z-x)/h)\), the expected weighted kernel contribution is proportional to its population counterpart. Taking \(g(x)=1\) shows that the expected total weight is proportional to \(1/c\). Their ratio therefore estimates the population kernel smoothing, rather than smoothing the selected density \(f_{\mathrm{obs}}\). Replacing the expectations by sample sums gives the normalized inverse-probability-weighted estimate above.

This argument describes the target before sampling variability and smoothing bias are considered. For a finite bandwidth, the estimate is a smoothed version of the population density, not a pointwise exact recovery of \(f_X\). As with any kernel estimate, results depend on the kernel and bandwidth. Here, the bandwidth is treated as given; changing it to address incomplete-data sampling is a separate decision.

For the calculations below, use the Epanechnikov kernel

$$ K(u)= \begin{cases} \frac{3}{4}(1-u^2), & |u|\leq 1,\\ 0, & |u|>1. \end{cases} $$

Its compact support makes it possible to see exactly which observations contribute at a target value. The resulting density estimate has units reciprocal to the loss measurement units.

Worked Example: Correcting a Uniform-Threshold Selection Effect

A hypothetical study records losses \(x_i=1,2,4,5\), measured in thousands of dollars. Each loss is observed when it exceeds an independent threshold \(T\), where \(T\) is uniform on \((0,5)\). Using the Epanechnikov kernel and \(h=2\), calculate the naive and weighted estimates at \(x=2\). State which method is appropriate for estimating the population-smoothed density.

Method and observation probabilities. For \(0<x<5\), \(\pi(x)=P(T<x)=x/5\); at \(x=5\), \(\pi(5)=1\), since the continuous threshold is below 5 with probability one. Thus the probabilities for losses \(1,2,4,5\) are \(0.2,0.4,0.8,1\), and the inverse weights are \(5,2.5,1.25,1\). The total weight is \(5+2.5+1.25+1=9.75\).

Kernel contributions. At target \(x=2\), the standardized distances \((2-x_i)/2\) are \(0.5,0,-1,-1.5\). The corresponding kernel values are \(K(0.5)=\frac{3}{4}(1-0.25)=0.5625\), \(K(0)=0.75\), and \(K(-1)=K(-1.5)=0\). The weighted kernel sum is \(5(0.5625)+2.5(0.75)=2.8125+1.875=4.6875\).

Weighted estimate. The denominator is \(h\sum_i w_i=2(9.75)=19.5\). Therefore \(\widehat f_{\mathrm{IPW}}(2)=4.6875/19.5=0.2403846\), or 0.2404 per thousand dollars to four decimal places.

Naive estimate. The unweighted kernel sum is \(0.5625+0.75=1.3125\), and \(nh=4(2)=8\). Thus \(\widehat f_{\mathrm{naive}}(2)=1.3125/8=0.1640625\), or 0.1641 per thousand dollars to four decimal places. The weighted estimate is appropriate for the population target under the stated selection assumptions. The naive estimate smooths the selected losses and does not correct their unequal observation probabilities. A common mistake is to report the naive value as if all losses had equal chances of entering the data.

Working With Different Truncation Probabilities

Observation probabilities need not change linearly with loss. They are determined by the threshold mechanism, and an adjustment should use that mechanism rather than a guessed trend. The next example uses a discrete threshold distribution and shows how the weights and kernel contributions combine.

Worked Example: A Discrete Threshold Mechanism

In a hypothetical portfolio study, thresholds are independently selected with equal probability from \(0,2,4\), and a loss is recorded only if it exceeds its threshold. The observed losses are \(1,3,5\). Using the Epanechnikov kernel and bandwidth \(h=3\), calculate both estimates at \(x=3\). Give answers to four decimal places.

Method and weights. At loss 1, only threshold 0 is lower, so \(\pi(1)=1/3\). At loss 3, thresholds 0 and 2 are lower, so \(\pi(3)=2/3\). At loss 5, all three thresholds are lower, so \(\pi(5)=1\). The inverse weights are \(3,1.5,1\), with sum \(5.5\).

Kernel values. The standardized distances from the target are \((3-1)/3=2/3\), \(0\), and \((3-5)/3=-2/3\). For either endpoint, \(K(2/3)=K(-2/3)=\frac{3}{4}(1-4/9)=5/12\); at the center, \(K(0)=3/4\).

Weighted calculation. The weighted kernel sum is \(3(5/12)+1.5(3/4)+1(5/12)=5/4+9/8+5/12=67/24\). The denominator is \(3(5.5)=16.5\). Hence \(\widehat f_{\mathrm{IPW}}(3)=(67/24)/16.5=67/396=0.1691919\), or 0.1692 per loss unit.

Naive calculation and check. The unweighted kernel sum is \(5/12+3/4+5/12=19/12\), and \(nh=3(3)=9\). Thus \(\widehat f_{\mathrm{naive}}(3)=(19/12)/9=19/108=0.1759259\), or 0.1759 per loss unit. The two calculations differ because the observed low loss receives a larger inverse weight, not because its kernel value changes. The common mistake this avoids is assigning equal weights merely because each value appears once in the observed sample.

Conditions and Limits of the Adjustment

Inverse-probability weighting is not a way to manufacture information in regions where losses could never have been observed. The condition \(\pi(x)>0\) is often called positivity or overlap. If it fails on part of the population support, the weighted data cannot identify the population density there without additional assumptions or information.

Even when every relevant probability is positive, very small probabilities produce large weights. A single large weight can make the estimate highly variable, because one observed loss then represents many losses that were unlikely to enter the sample. This is a limitation to report and investigate, not a reason to silently replace the inverse weight with an arbitrary value.

Worked Example: Recognizing a Region That Cannot Be Recovered

A hypothetical data collection process uses the same fixed threshold \(T=5\) for every loss and records a loss only when \(X>5\). An analyst has observed losses \(6,7,8\), and proposes estimating the population density at \(x=4\) by inverse-probability weighting. Assess the proposal and identify what can be calculated from the three records.

Check observation probability first. For every \(x\leq5\), \(\pi(x)=P(T<x)=0\). Consequently, the proposed weight \(1/\pi(4)\) is undefined. No observed loss can fall in the region at or below the threshold, so these records alone cannot estimate the population density at \(x=4\).

What happens above the threshold? For \(x>5\), \(\pi(x)=1\), so the inverse weights of the three observed losses are all 1. For example, with bandwidth \(h=2\), the estimate at \(x=7\) is calculated from distances \(0.5,0,-0.5\). The kernel sum is \(0.5625+0.75+0.5625=1.875\), and the denominator is \(2(3)=6\). Both the naive and weighted estimate are \(1.875/6=0.3125\) per loss unit.

Conclusion and trap. The equality above the threshold does not establish that the full population density is estimated: the observed data contain no information below 5 under this design. Treating the zero observation probability at 4 as if it were a small positive number and assigning an enormous weight is not a valid correction. It changes the assumed selection mechanism without supplying the missing observations.

Exam Checks for a Defensible Estimate

Before calculating, specify the target population, the selection rule, and the observation probabilities. Then check that the loss values used in the estimate satisfy the truncation rule and that the probabilities are positive. Apply the kernel at the requested target using the stated bandwidth, multiply by inverse probabilities, and divide by \(h\) times the sum of those weights. Finally, compare with the naive estimate only as a description of the selected sample; the two need not differ in a fixed direction at every target value.

  • Use inverse, not direct, probabilities. A loss with observation probability \(0.2\) receives weight \(5\), not \(0.2\).
  • Normalize with the weights. The weighted denominator is \(h\sum_i w_i\), not \(nh\).
  • Check the support. If \(\pi(x)=0\), the inverse-probability estimate cannot recover the population density at that value.
  • Keep the target clear. The naive estimate smooths the observed distribution; the weighted estimate aims at a smoothed population distribution under its assumptions.
Key takeaway: Left truncation makes the observed loss density proportional to the population density times the observation probability. Inverse-probability weights correct this selection effect where observation probabilities are positive, and weighted normalization is part of the estimate.

Check Your Understanding

For each problem, use the Epanechnikov kernel defined above. Treat the stated bandwidth as fixed, and give density estimates to four decimal places where applicable.

  1. Thresholds are uniform on \((0,4)\), and observed losses are \(1,2,4\). Calculate the naive and inverse-probability-weighted estimates at \(x=2\) with \(h=2\). (Answer: naive \(0.2188\); weighted \(0.2143\) per loss unit.)
  2. Thresholds are equally likely to be 0 or 3, and observed losses are \(2,5\). Find the inverse-probability-weighted estimate at \(x=3.5\) with \(h=3\). (Answer: \(0.1875\) per loss unit.)
  3. A fixed threshold of 5 is used for all losses, with observation only when \(X>5\). Can the observed records identify the population density at \(x=4\) by inverse-probability weighting? (Answer: No; \(\pi(4)=0\), so the required weight is undefined.)
  4. A threshold is uniform on \((0,8)\). Observed losses are \(2,4,6\), and \(h=2\). Calculate the weighted estimate at \(x=4\). (Answer: \(0.1023\) per loss unit.)
  5. A threshold is uniform on \((0,8)\). Observed losses are \(1,3,5,7\), and \(h=4\). Calculate the naive and weighted estimates at \(x=4\). (Answer: naive \(0.1289\); weighted \(0.1195\) per loss unit.)
Clinical Biostats