Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Local Polynomial Boundary Correction

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

Local Polynomial Boundary Correction

Use local polynomial boundary correction to estimate a density at zero, understand its bias and variance, and compare it with ordinary and reflection kernel estimators.

Advanced 10 min read

What You'll Learn

  • Derive the local linear equivalent kernel from moment conditions at a nonnegative support boundary
  • Calculate boundary estimates using the uniform and triangular kernels
  • Compare local linear, ordinary, and reflection estimates at zero
  • Explain how the correction removes first-order slope bias under smoothness assumptions
  • Recognize negative equivalent-kernel weights and the possibility of a negative density estimate

Why Correct a Kernel Estimate at a Boundary?

A loss amount cannot be negative, so its density is supported on the nonnegative half-line. A symmetric kernel centered at zero nevertheless places part of its smoothing mass below zero, where no observations can occur. Ordinary kernel density estimation therefore tends to underestimate the density at the boundary. Reflection can restore the missing kernel mass, but it does not generally remove bias caused by a nonzero slope in the density at zero.

Local polynomial boundary correction addresses that slope by choosing weights that reproduce a constant density while canceling a linear trend. The correction is useful when estimating a density near the edge of its support, but its weights can be negative. This means a finite-sample estimate can itself be negative, even though a true density cannot be.

Definition: Let \(X_1,\ldots,X_n\) be independent observations from a continuous loss distribution with density \(f\) on \([0,\infty)\). For bandwidth \(h>0\) and a symmetric kernel \(K\) supported on \([-1,1]\), the ordinary kernel density estimate at zero is $$ \widehat f_{\mathrm{ord}}(0)=\frac{1}{nh}\sum_{i=1}^n K\left(\frac{X_i}{h}\right). $$ The reflection estimate at zero adds a mirrored kernel contribution for each observation: $$ \widehat f_{\mathrm{ref}}(0)=\frac{1}{nh}\sum_{i=1}^n\left\{K\left(\frac{X_i}{h}\right)+K\left(-\frac{X_i}{h}\right)\right\}. $$ These formulas use exact, uncensored observations; they do not by themselves adjust for truncation or censoring.

Because \(K\) is symmetric, the two terms in each reflection contribution are equal. Reflection therefore doubles the ordinary estimate at zero. That restores unit mass for the reflected boundary kernel, but the resulting weights still have a positive first moment. Local linear correction instead targets both the zeroth and first moments.

Constructing the Local Linear Boundary Kernel

Consider a nonnegative loss \(X_i\) near zero and set \(u_i=X_i/h\). Use the one-sided kernel moments \(s_j=\int_0^1 u^jK(u)\,du\), for \(j=0,1,2\), where the kernel has support \([-1,1]\). Seek an equivalent boundary kernel of the form \(L(u)=K(u)(a+bu)\) for \(0\leq u\leq1\). Its weights should preserve a constant density and cancel a density that changes linearly across the boundary.

$$ \int_0^1 L(u)\,du=1,\qquad \int_0^1 uL(u)\,du=0. $$

The first condition makes the estimate reproduce a constant density. The second removes the contribution of the density's first derivative. Substituting \(L(u)=K(u)(a+bu)\) gives two equations for \(a\) and \(b\).

$$ as_0+bs_1=1,\qquad as_1+bs_2=0. $$

If \(D=s_0s_2-s_1^2>0\), solving these equations yields \(a=s_2/D\) and \(b=-s_1/D\). The estimator is the sum of the resulting weights, divided by \(nh\).

Definition: The local linear equivalent kernel at the zero boundary is $$ L(u)=K(u)\frac{s_2-s_1u}{s_0s_2-s_1^2},\qquad 0\leq u\leq1, $$ and the corresponding estimate is $$ \widehat f_{\mathrm{LL}}(0)=\frac{1}{nh}\sum_{i=1}^n L\left(\frac{X_i}{h}\right). $$ An observation with \(X_i/h>1\) contributes zero for a kernel supported on \([-1,1]\). The formula requires a nondegenerate kernel for which \(s_0s_2-s_1^2>0\).

For the uniform kernel \(K(u)=1/2\) on \([-1,1]\), the one-sided moments are \(s_0=1/2\), \(s_1=1/4\), and \(s_2=1/6\). Thus \(D=1/48\), and the equivalent kernel simplifies to \(L(u)=4-6u\) on \([0,1]\). Its integral is \(4-3=1\), and its first moment is \(2-2=0\). The kernel becomes negative for \(u>2/3\), a direct consequence of correcting the first moment.

What the Moment Correction Achieves

Suppose \(f\) has two continuous derivatives from the right near zero. The expectation of the local linear estimate can be written as an integral over the one-sided support. Expanding the density around zero explains the role of the two moment conditions.

$$ E[\widehat f_{\mathrm{LL}}(0)] =\int_0^1 L(u)f(hu)\,du =f(0)\int_0^1L(u)\,du +hf'(0)\int_0^1uL(u)\,du +\frac{h^2f''(0)}{2}\int_0^1u^2L(u)\,du+o(h^2). $$

The first two integrals are 1 and 0 by construction. Consequently the constant term is \(f(0)\) and the term proportional to \(h f'(0)\) vanishes. When the indicated smoothness holds, the leading bias is of order \(h^2\), rather than the order-\(h\) slope bias that can remain with ordinary or reflection smoothing. This is a bias result, not a guarantee that every finite-sample estimate is nonnegative or close to the truth.

For a fixed kernel and a density that is positive at zero, the estimator's variance is typically of order \(1/(nh)\). The correction changes the constant in that variance through \(\int_0^1 L(u)^2\,du\). Thus, as with kernel estimation generally, the bandwidth balances bias against sampling variability. Bandwidth choice is not the focus here.

Worked Comparisons and Calculations

Worked Example: Comparing Three Estimates With a Uniform Kernel

A hypothetical portfolio has exact losses of \(0.20\), \(0.50\), and \(0.70\) thousand dollars. Estimate the density at zero using bandwidth \(h=1\) thousand dollars and the uniform kernel \(K(u)=1/2\) for \(|u|\leq1\), zero otherwise. Calculate the ordinary, reflection, and local linear estimates.

Method and setup. There are \(n=3\) observations, and the scaled losses are \(u_1=0.20\), \(u_2=0.50\), and \(u_3=0.70\). All lie in the kernel's one-sided support. Since \(nh=3(1)=3\), each estimate uses a denominator of 3.

Ordinary estimate. Each kernel value is \(1/2\), so the sum of the three contributions is \(3(1/2)=1.5\). Therefore $$ \widehat f_{\mathrm{ord}}(0)=\frac{1.5}{3}=0.5000 $$ per thousand dollars.

Reflection estimate. For each loss, both \(K(u_i)\) and \(K(-u_i)\) equal \(1/2\). Each observation contributes 1 before division by \(nh\), giving a total contribution of 3. Hence $$ \widehat f_{\mathrm{ref}}(0)=\frac{3}{3}=1.0000 $$ per thousand dollars.

Local linear estimate. The uniform-kernel equivalent weights are \(4-6u_i\). They are \(4-6(0.20)=2.8\), \(4-6(0.50)=1.0\), and \(4-6(0.70)=-0.2\). Their sum is \(2.8+1.0-0.2=3.6\), so $$ \widehat f_{\mathrm{LL}}(0)=\frac{3.6}{3}=1.2000 $$ per thousand dollars.

Check and trap avoided. The local linear weights sum to 3.6, so the estimate is 1.2, not the reflection value of 1.0. A common mistake is to assume reflection and local linear correction are the same operation because both address a boundary. They use different weights and impose different moment conditions.

Worked Example: Applying the Bandwidth Before Summing

A hypothetical set of four losses, measured in thousands of dollars, is \(0.10\), \(0.20\), \(0.40\), and \(0.80\). Use bandwidth \(h=0.50\) thousand dollars and the uniform kernel to find the local linear estimate at zero. Compare it with the ordinary estimate.

Method. Scale each loss by the bandwidth before using the equivalent kernel. The scaled observations are \(0.10/0.50=0.20\), \(0.20/0.50=0.40\), \(0.40/0.50=0.80\), and \(0.80/0.50=1.60\). The last observation is outside the support and contributes zero. Here \(nh=4(0.50)=2\).

Local linear estimate. For the first three scaled observations, the weights are \(4-6(0.20)=2.8\), \(4-6(0.40)=1.6\), and \(4-6(0.80)=-0.8\). Their sum is \(2.8+1.6-0.8=3.6\). Thus $$ \widehat f_{\mathrm{LL}}(0)=\frac{3.6}{2}=1.8000 $$ per thousand dollars.

Ordinary estimate. The first three observations contribute \(1/2\) each, and the fourth is outside the kernel support. The total is \(1.5\), so $$ \widehat f_{\mathrm{ord}}(0)=\frac{1.5}{2}=0.7500 $$ per thousand dollars.

Check and trap avoided. Both estimates have units of reciprocal thousand dollars because the denominator includes \(h\). Using \(n\) instead of \(nh\) would produce an incorrect scale. The loss \(0.80\) is excluded because its scaled value is \(1.60\), not because its original value exceeds a universal threshold.

Worked Example: Local Linear Correction With a Triangular Kernel

A hypothetical set of three positive losses, measured in thousands of dollars, is \(0.25\), \(0.75\), and \(1.50\). Estimate the density at zero with bandwidth \(h=2\) thousand dollars and the triangular kernel \(K(u)=1-|u|\) for \(|u|\leq1\), zero otherwise.

Find the equivalent kernel. On the one-sided interval, \(K(u)=1-u\). Its moments are \(s_0=\int_0^1(1-u)\,du=1/2\), \(s_1=\int_0^1u(1-u)\,du=1/6\), and \(s_2=\int_0^1u^2(1-u)\,du=1/12\). Thus \(D=(1/2)(1/12)-(1/6)^2=1/24-1/36=1/72\). The equivalent kernel is $$ L(u)=(1-u)\frac{1/12-u/6}{1/72}=6(1-u)(1-2u). $$

Scale and weight the observations. The scaled losses are \(0.25/2=0.125\), \(0.75/2=0.375\), and \(1.50/2=0.750\), all within the support. Their weights are \(L(0.125)=6(0.875)(0.75)=3.9375\), \(L(0.375)=6(0.625)(0.25)=0.9375\), and \(L(0.750)=6(0.25)(-0.50)=-0.7500\). The sum is \(3.9375+0.9375-0.7500=4.1250\).

Divide by \(nh\). Here \(nh=3(2)=6\), so the estimate is \(4.1250/6=0.6875\) per thousand dollars.

Check and trap avoided. The weights sum to \(4.1250\), and division by 6 gives \(0.6875\). The negative third weight is permitted by local linear correction. Replacing it with zero would define a different estimator and invalidate the moment correction used here.

Interpreting the Three Boundary Methods

MethodBoundary weighting ideaKey implication
Ordinary kernelUses the original symmetric kernel; part of its mass lies outside the support.At zero, it generally has a missing-mass bias, including a nonzero leading bias even for a locally constant density.
ReflectionAdds a mirrored kernel contribution from each observation.Restores boundary mass, but its positive first moment can leave a bias of order \(h\) when \(f'(0)\ne0\).
Local linearChooses weights with zeroth moment 1 and first moment 0.Removes the first-order slope term under smoothness assumptions, but may have negative weights and produce a negative estimate.

For the uniform kernel, the ordinary boundary kernel on the positive side is \(1/2\), with integral \(1/2\) and first moment \(1/4\). Reflection doubles it to 1, with integral 1 but first moment \(1/2\). The local linear equivalent kernel \(4-6u\) has integral 1 and first moment 0. These moments explain why the three estimates can differ substantially in a small sample.

A density estimate below zero is not a valid probability density value, but it can occur as an intermediate local polynomial estimate. A practitioner who imposes nonnegativity afterward should recognize that clipping changes the estimator and its bias properties. Local polynomial correction is most useful when a smoother boundary estimate is needed and the possibility of negative finite-sample estimates is understood.

Check Your Understanding

Use the formulas in this tutorial. Unless stated otherwise, use the uniform kernel \(K(u)=1/2\) on \([-1,1]\), and report estimates to four decimal places.

  1. For losses \(0.10\), \(0.40\), and \(0.80\), with \(h=1\) and \(n=3\), calculate the local linear estimate at zero. (Answer: 1.4000 per loss unit)
  2. For losses \(0.10\), \(0.20\), \(0.40\), and \(0.80\), with \(h=0.50\) and \(n=4\), calculate the local linear estimate at zero, accounting for observations outside kernel support. (Answer: 1.8000 per loss unit)
  3. For losses \(0.25\), \(0.75\), and \(1.50\), with \(h=2\) and the triangular kernel \(K(u)=1-|u|\), calculate the local linear estimate at zero. (Answer: 0.6875 per loss unit)
  4. For losses \(0.20\), \(0.60\), and \(1.20\), with \(h=1\) and \(n=3\), calculate the ordinary and reflection estimates at zero using the uniform kernel. (Answer: ordinary 0.3333 and reflection 0.6667 per loss unit)
  5. For losses \(0.70\) and \(0.90\), with \(h=1\) and \(n=2\), calculate the local linear estimate at zero using the uniform kernel. State the two weights and their signs. (Answer: weights \(-0.2000\) and \(-1.4000\), both negative; estimate \(-0.8000\) per loss unit)
Clinical Biostats