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

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

Kernel Density Estimation From Exact Losses

Build and calculate kernel density estimates from exact loss observations, with careful attention to normalization, bandwidth, units, and kernel contributions.

Advanced 12 min read

What You'll Learn

  • Define the kernel density estimator for exact continuous loss observations.
  • State the assumptions needed to apply the estimator.
  • Explain why a normalized kernel produces an estimate that integrates to one.
  • Calculate density estimates using a triangular kernel and a specified bandwidth.
  • Interpret the bandwidth, the density estimate’s units, and its distinction from a probability at one loss amount.
  • Identify common calculation errors involving kernel support and the factor of bandwidth.

Why Smooth Exact Loss Observations?

A set of exact loss amounts contains information about where losses occur, but it does not by itself provide a smooth estimate of the underlying loss density. A histogram can summarize the data, yet its appearance depends on how its bins are placed and how wide they are. Kernel density estimation provides another approach: it places a smooth, rescaled kernel around each observed loss and averages those contributions.

The method here applies to exact, continuous loss observations. It does not adjust for censoring or truncation, and its observations are treated as an independent sample from a common loss distribution. The density is unknown; the estimator describes a smoothed version of the observed sample rather than fitting a specified parametric distribution.

Definition: Let \(X_1,\ldots,X_n\) be exact observations of independent losses with a common continuous density. Let \(K\) be a kernel satisfying \(K(u)\geq 0\) and \(\int_{-\infty}^{\infty}K(u)\,du=1\), and let \(h>0\) be a bandwidth. The kernel density estimator at loss amount \(x\) is $$ \widehat f_h(x)=\frac{1}{nh}\sum_{i=1}^{n}K\!\left(\frac{x-X_i}{h}\right). $$

The kernel \(K\) determines the contribution from an observation according to its distance from the target \(x\), measured in bandwidth units. The bandwidth \(h\) sets the scale: a larger \(h\) spreads each observation’s contribution over a wider range. For the calculations below, a convenient normalized example is the triangular kernel $$ K(u)= \begin{cases} 1-|u|, & |u|\leq 1,\\ 0, & |u|>1. \end{cases} $$ Its contribution is zero when the observation is more than one bandwidth from the target. Its total area is one: each half of its triangular graph has base \(1\) and height \(1\), so the two halves have total area \(1/2+1/2=1\).

Why the Estimate Is Normalized

A density integrates to one over its whole range. The estimator has this property when the kernel is normalized, even though its value at an individual loss amount can be above or below one. To see why, integrate the estimator over \(x\). For each observation, substitute \(u=(x-X_i)/h\), so \(dx=h\,du\):

$$ \begin{aligned} \int_{-\infty}^{\infty}\widehat f_h(x)\,dx &=\frac{1}{nh}\sum_{i=1}^{n} \int_{-\infty}^{\infty}K\!\left(\frac{x-X_i}{h}\right)\,dx\\ &=\frac{1}{nh}\sum_{i=1}^{n}h\int_{-\infty}^{\infty}K(u)\,du\\ &=\frac{1}{nh}\sum_{i=1}^{n}h =1. \end{aligned} $$

This also explains the \(1/h\) factor in the estimator: stretching a kernel horizontally by a factor of \(h\) requires dividing its height by \(h\) to preserve its area. The factor \(1/n\) then averages the \(n\) contributions. If \(X_i\) and \(x\) are measured in dollars, \(h\) is measured in dollars and \(\widehat f_h(x)\) is measured in inverse dollars. It is a density, not the probability of observing exactly \(x\); for a continuous loss distribution, the probability at one exact point is zero.

Worked Example: Estimating Density at a Midpoint

A hypothetical portfolio has four exact loss observations, in dollars: \(20, 30, 40,\) and \(50\). Estimate the density at \(x=35\) using the triangular kernel above and bandwidth \(h=10\) dollars. Assume the losses are independent observations from a common continuous distribution. Interest and mortality assumptions do not apply to this density calculation.

Method. Calculate the standardized distance \(u_i=(x-X_i)/h\) for each observation, evaluate the kernel, sum its contributions, and divide by \(nh\).

For \(X_1=20\), \(u_1=(35-20)/10=1.5\), so \(K(u_1)=0\). For \(X_2=30\), \(u_2=0.5\), so \(K(u_2)=1-0.5=0.5\). For \(X_3=40\), \(u_3=-0.5\), so \(K(u_3)=1-|-0.5|=0.5\). For \(X_4=50\), \(u_4=-1.5\), so \(K(u_4)=0\).

The sum of contributions is \(0+0.5+0.5+0=1\), and \(nh=4(10)=40\) dollars. Therefore, $$ \widehat f_{10}(35)=\frac{1}{40}=0.0250\text{ per dollar}. $$ The estimate is positive because two losses are within one bandwidth of \(35\). A common mistake is to divide by \(n=4\) alone, giving \(0.25\); that omits the bandwidth factor and has the wrong units. The density estimate has units of inverse dollars, as required.

Calculating Contributions Carefully

A reliable calculation separates the standardized distance, the kernel value, and the final denominator. For the triangular kernel, the absolute value matters: an observation below \(x\) and one above \(x\) at the same distance have equal contributions. The support condition matters as well: values with \(|u|>1\) contribute zero, not a negative amount.

1
Check the data and units.
Confirm that each \(X_i\) is an exact loss and that \(x\), \(X_i\), and \(h\) use the same loss unit.
2
Standardize each distance.
Compute \(u_i=(x-X_i)/h\). The sign indicates which side of the target the observation lies on; the kernel may use the absolute distance.
3
Evaluate and add kernel values.
Apply the stated kernel, including its support condition, to obtain \(\sum_i K(u_i)\).
4
Divide by \(nh\).
The result is a density estimate in inverse units of loss, not a probability at \(x\).

Worked Example: Accounting for the Kernel Support

A hypothetical insurer records three exact losses of \(98.4\), \(96.8\), and \(95.2\) dollars. Estimate the density at \(x=100\) dollars using the triangular kernel and \(h=4\) dollars. Assume independent observations from a common continuous loss distribution; interest and mortality assumptions do not apply.

The standardized distances are \(u_1=(100-98.4)/4=0.4\), \(u_2=(100-96.8)/4=0.8\), and \(u_3=(100-95.2)/4=1.2\). The corresponding kernel values are \(K(0.4)=1-0.4=0.6\), \(K(0.8)=1-0.8=0.2\), and \(K(1.2)=0\), because \(1.2\) is outside the kernel’s support.

Thus the contribution sum is \(0.6+0.2+0=0.8\), and \(nh=3(4)=12\) dollars. The estimated density is $$ \widehat f_4(100)=\frac{0.8}{12}=0.0667\text{ per dollar}, $$ rounded to four decimal places. This calculation illustrates why the support rule is essential. Substituting \(u=1.2\) into \(1-|u|\) without checking support would give \(-0.2\), which is not a valid triangular-kernel contribution. The correct contribution is zero, and the sum of the valid kernel values is \(0.8\).

Worked Example: Comparing Estimates at Two Loss Amounts

A hypothetical dataset consists of exact losses \(40\), \(44\), and \(52\) dollars, treated as independent observations from a common continuous distribution. Using the triangular kernel and bandwidth \(h=8\) dollars, calculate the estimated densities at \(x=44\) and \(x=48\). Interest and mortality assumptions do not apply.

At \(x=44\), the standardized distances are \(u_1=(44-40)/8=0.5\), \(u_2=0\), and \(u_3=(44-52)/8=-1\). Their kernel values are \(0.5\), \(1\), and \(0\), respectively. The sum is \(1.5\), and \(nh=3(8)=24\). Therefore, $$ \widehat f_8(44)=\frac{1.5}{24}=0.0625\text{ per dollar}. $$

At \(x=48\), the standardized distances are \(u_1=1\), \(u_2=0.5\), and \(u_3=-0.5\). The kernel values are \(0\), \(0.5\), and \(0.5\). Their sum is \(1\), so $$ \widehat f_8(48)=\frac{1}{24}=0.0417\text{ per dollar}, $$ rounded to four decimal places. The larger estimate at \(44\) reflects the kernel contributions at that particular target; it is not a probability comparison between the exact points. As a check, both calculations use the same denominator \(24\), since \(n\) and \(h\) have not changed.

Common Errors and Interpretation

  • Omitting the bandwidth. The denominator is \(nh\), not merely \(n\). Omitting \(h\) changes both the numerical result and its units.
  • Using an invalid kernel value outside its support. For the triangular kernel, \(K(u)=0\) whenever \(|u|>1\); do not continue the expression \(1-|u|\) beyond that interval.
  • Confusing density with probability. A density value can exceed one, and it is not the probability of a loss equaling that exact amount. Probabilities over intervals are obtained by integrating a density over those intervals.
  • Mixing units. If losses are recorded in thousands of dollars, the bandwidth must also be in thousands of dollars, and the resulting density is per thousand dollars. Convert units consistently before comparing density values.
  • Applying the estimator to incomplete observations as if they were exact. The formula here uses exact observations. Censoring or truncation changes what is observed and requires methods that account for that observation mechanism.
Key takeaway: For exact losses, calculate each standardized distance, apply a normalized kernel, sum the valid contributions, and divide by \(nh\). The resulting estimate is a density with reciprocal-loss units and integrates to one over the full real line.

Check Your Understanding

For each problem, use the stated kernel and bandwidth. Treat the observations as independent exact losses from a common continuous distribution; interest and mortality assumptions do not apply. Round density estimates to four decimal places where needed.

  1. Exact losses are \(10\) and \(14\) dollars. Using the triangular kernel with \(h=4\) dollars, estimate the density at \(x=12\). (Answer: \(0.1250\) per dollar)
  2. Exact losses are \(40\), \(44\), and \(52\) dollars. Using the triangular kernel with \(h=8\) dollars, estimate the density at \(x=48\). (Answer: \(0.0417\) per dollar)
  3. Exact losses are \(67\), \(66\), and \(64\) dollars. Using the triangular kernel with \(h=5\) dollars, estimate the density at \(x=70\). (Answer: \(0.0400\) per dollar)
  4. Exact losses are \(200\), \(206\), and \(215\) dollars. Use the uniform kernel \(K(u)=1/2\) for \(|u|\leq1\), and \(K(u)=0\) otherwise, with \(h=10\) dollars. Estimate the density at \(x=205\), treating the boundary \(|u|=1\) as included. (Answer: \(0.0500\) per dollar)
  5. For any normalized kernel and bandwidth \(h>0\), explain why the estimator \(\widehat f_h(x)=\frac{1}{n}\sum_{i=1}^n K((x-X_i)/h)\) is missing a factor. State the corrected estimator and the units of that factor. (Answer: Divide by \(h\); the corrected estimator is \(\widehat f_h(x)=\frac{1}{nh}\sum_{i=1}^n K((x-X_i)/h)\), and \(1/h\) has inverse-loss units.)
Clinical Biostats