Why Kernel Choice and Scaling Matter
In kernel density estimation, each observed loss contributes a smooth, localized weight to the estimated density. The kernel determines the shape of that contribution; its scale determines how wide and how tall it is. A kernel may be symmetric and normalized yet still be used incorrectly if its scale factor is omitted. That error changes the integral of the estimate, so the result is no longer a density.
This tutorial compares common kernel functions using their symmetry, support, and moments. It then derives the scaling rule and applies it to hypothetical loss data. The focus is on the kernel and its rescaling, not on selecting a bandwidth or analyzing the estimator's bias and variance.
Many standard kernels are continuous, symmetric probability density functions. Other conventions also admit kernels that take negative values, especially in higher-order methods. The comparisons here concern the familiar nonnegative kernels used in basic kernel density estimation.
Common Kernels and Their Properties
A kernel's support describes where it is concentrated. Two support conventions should be distinguished. Its pointwise support is the closure of the set on which its specified version is nonzero. Its essential support is the complement of the largest open set on which it is zero almost everywhere. For an arbitrary density these need not agree: changing a density at a single point can alter its pointwise support without changing its essential support. For continuous kernels such as those in the table, the two notions agree; some texts use “support” to mean essential support by definition.
For compactly supported kernels, the support is contained in a finite interval. The Gaussian kernel, in contrast, is positive on the whole real line and has infinite support. Moment comparisons help describe how a kernel weights values farther from its center. They are properties of the kernel function itself, not of the observed loss sample.
| Kernel | Definition | Symmetry and support | Second moment \(\mu_2(K)\) |
|---|---|---|---|
| Uniform | \(K(u)=1/2\) for \(|u|\leq 1\), and 0 otherwise | Symmetric; \([-1,1]\) | \(1/3\) |
| Triangular | \(K(u)=1-|u|\) for \(|u|\leq 1\), and 0 otherwise | Symmetric; \([-1,1]\) | \(1/6\) |
| Epanechnikov | \(K(u)=\frac{3}{4}(1-u^2)\) for \(|u|\leq 1\), and 0 otherwise | Symmetric; \([-1,1]\) | \(1/5\) |
| Gaussian | \(K(u)=\frac{1}{\sqrt{2\pi}}e^{-u^2/2}\) | Symmetric; all real numbers | \(1\) |
The constants in these definitions ensure that each kernel integrates to 1. Symmetry makes the first moment 0 when it exists. For example, the uniform kernel's second moment is
The triangular and Epanechnikov kernels also have finite support and are symmetric, but their weights decrease toward the endpoints. For the Gaussian kernel, the standard normal density has mean 0 and variance 1, so its second moment is 1. Compact support means observations outside the kernel's scaled interval make no contribution at a given evaluation point; the Gaussian kernel assigns positive weight at every finite distance.
Worked Example: Verifying Kernel Normalization and Moments
A hypothetical analyst is considering uniform, triangular, and Epanechnikov kernels for loss data. Verify that each integrates to 1, is symmetric, and has the second moment listed in the table. State the method and identify a common calculation error.
Method. Integrate over the support, use symmetry to write even-moment integrals as twice the integral from 0 to 1, and check the first moment from symmetry. For all three kernels, the function depends on \(|u|\) or \(u^2\), so \(K(u)=K(-u)\), and hence \(\mu_1(K)=0\).
Uniform kernel. Its integral is \(\int_{-1}^{1}(1/2)\,du=1\). Its second moment is \(\int_{-1}^{1}(u^2/2)\,du=1/3\), as calculated above.
Triangular kernel. Its integral is
Its second moment is
Epanechnikov kernel. Its integral is
Its second moment is
All three integrals equal 1, and their second moments match the table. Common mistake: doubling the integral over \([0,1]\) for the normalization check but forgetting to double it for the second moment. The correction is to apply the same symmetry step to both integrals.
Rescaling a Kernel
Let \(K\) be a normalized kernel and let \(a>0\) be a scale factor. The rescaled kernel is
The argument \(u/a\) stretches the function horizontally by \(a\). The factor \(1/a\) reduces its height to preserve its total integral. In kernel density estimation, the scale \(h>0\) is called the bandwidth, and the scaled kernel is \(K_h(u)=h^{-1}K(u/h)\). For a sample \(X_1,\ldots,X_n\) of exact observations, the kernel density estimate at \(x\) is
The equivalent forms make the scale factor explicit. A kernel that is supported on \([-1,1]\) becomes supported on \([-h,h]\) after scaling. The height of the individual scaled kernel is also multiplied by \(1/h\).
The same substitution shows how moments change. When the relevant moment exists, \(\mu_r(K_a)=a^r\mu_r(K)\). In particular, if \(K\) is symmetric with a finite second moment, the rescaled kernel remains symmetric and its second moment is \(a^2\mu_2(K)\). The density estimate also integrates to 1: each term \(K_h(x-X_j)\), integrated over \(x\), has integral 1, and the estimate averages those terms.
Worked Example: Comparing Two Bandwidths for Hypothetical Losses
Three hypothetical loss amounts, measured in thousands of dollars, are \(X_1=2\), \(X_2=4\), and \(X_3=6\). Use the triangular kernel to estimate the density at \(x=3.2\) for bandwidths \(h=1\) and \(h=2\). Report densities per thousand dollars, rounded to four decimal places. Name the method and the scaling error to avoid.
Method. For the triangular kernel, \(K(u)=1-|u|\) when \(|u|\leq1\), and \(K(u)=0\) otherwise. Calculate each standardized distance \(u_j=(x-X_j)/h\), evaluate the kernel, and divide the sum by \(nh\).
Bandwidth \(h=1\). The standardized distances for \(X_1=2\), \(X_2=4\), and \(X_3=6\) are \(1.2\), \(-0.8\), and \(-2.8\), respectively. Their kernel values are \(0\), \(1-0.8=0.2\), and \(0\), respectively. Thus
Bandwidth \(h=2\). The standardized distances are \(0.6\), \(-0.4\), and \(-1.4\). The corresponding kernel values are \(1-0.6=0.4\), \(1-0.4=0.6\), and \(0\). Therefore
The estimated densities are \(0.0667\) and \(0.1667\) per thousand dollars. The larger bandwidth changes both the standardized distances and the denominator. Common mistake: using the sum of kernel values divided by \(n\) alone. The correction is to divide by \(nh\), because the scaled kernel includes the factor \(1/h\).
Worked Example: Stretching an Epanechnikov Kernel
Start with the Epanechnikov kernel and rescale it by \(a=2\). Find its support, its value at \(u=1\), its value at \(u=0\), and its second moment. Verify that it still integrates to 1. State the method and the normalization trap.
Method. Apply \(K_2(u)=\frac{1}{2}K(u/2)\), then use the original support and second moment. The original kernel is \(K(u)=\frac{3}{4}(1-u^2)\) on \([-1,1]\), with \(\mu_2(K)=1/5\).
The original support \([-1,1]\) stretches to \([-2,2]\). At the center,
At \(u=1\), the original kernel is evaluated at \(1/2\):
The second moment scales by \(a^2\), so \(\mu_2(K_2)=2^2(1/5)=4/5\). Its integral is \(\frac{1}{2}\int K(u/2)\,du\); substituting \(z=u/2\), \(du=2\,dz\), gives \(\int K(z)\,dz=1\). Common mistake: using \(K(u/2)\) without the factor \(1/2\). That function has integral 2, not 1, and is not a normalized kernel.
Practical Checks and Exam Traps
Kernel formulas are simple, but their scale and units are easy to misread. Before interpreting a calculation, check that the argument is standardized by the bandwidth, that the height includes the reciprocal bandwidth, and that the density estimate integrates to 1. If loss amounts are recorded in thousands of dollars and \(h\) is also measured in thousands of dollars, the resulting density is per thousand dollars. A density is not itself a probability; probabilities are obtained by integrating it over an interval.
- Do not confuse kernel scale with bandwidth selection. Scaling states how a chosen kernel changes when stretched. It does not determine which bandwidth is appropriate.
- Keep the reciprocal scale factor. A horizontal stretch by \(h\) requires height \(1/h\) times the original height to preserve the integral.
- Check support after scaling. A kernel supported on \([-1,1]\) contributes only when \(|x-X_j|\leq h\). For the Gaussian kernel, there is no finite cutoff.
- Use the correct support convention. For arbitrary density versions, pointwise and essential supports can differ. Do not assert they always agree.
- Do not treat a kernel moment as a data moment. For instance, \(\mu_2(K)\) is calculated from \(K\), not from the observed losses.
These checks are aligned with the SOA Exam ASTAM (Advanced Short-Term Actuarial Mathematics) syllabus: the candidate should be able to recognize common kernels, track their scaling, and preserve the density's normalization without confusing this work with bandwidth-selection or bias-and-variance analysis.
Check Your Understanding
For each problem, track the kernel's support and scale as well as its values. Answers are given for checking.
- A triangular kernel is defined by \(K(u)=1-|u|\) for \(|u|\leq1\), and 0 otherwise. State its support, verify its normalization, and give its first and second moments. (Answer: Support \([-1,1]\); integral \(1\); \(\mu_1(K)=0\); \(\mu_2(K)=1/6\).)
- The uniform kernel is rescaled by \(a=3\). Give the rescaled support, its height on that support, and its second moment. (Answer: Support \([-3,3]\); height \(1/6\); second moment \(3^2(1/3)=3\).)
- Hypothetical losses, in thousands of dollars, are \(10\) and \(14\). Using the triangular kernel and \(h=2\), calculate the density estimate at \(x=11\), in density units per thousand dollars. (Answer: Standardized distances are \(0.5\) and \(-1.5\), kernel values are \(0.5\) and \(0\), and the estimate is \(0.5/(2\cdot2)=0.1250\) per thousand dollars.)
- Three hypothetical losses, in thousands of dollars, are \(0\), \(2\), and \(4\). Use an Epanechnikov kernel with \(h=2\) to estimate the density at \(x=2\). (Answer: Standardized distances are \(1,0,-1\); kernel values are \(0,3/4,0\); the estimate is \((3/4)/(3\cdot2)=0.1250\) per thousand dollars.)
- A kernel \(K\) integrates to 1, and a proposed rescaling is \(G(u)=K(u/4)\), without any multiplier. What is \(\int G(u)\,du\), and what multiplier makes the rescaling normalized? (Answer: The integral is \(4\); multiply by \(1/4\), giving \(K_4(u)=\frac{1}{4}K(u/4)\) with integral \(1\).)