---
title: "Kernel density estimation via diffusion — Botev 2010"
description: "Kernel density estimation via diffusion uses data-driven smoothing to adapt to local structure and reduce bias at known boundaries."
canonical: "https://research.elamur.ai/free/en/papers/botev-2010-kernel-density-estimation-diffusion/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/botev-2010-kernel-density-estimation-diffusion/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2010](https://md.research.elamur.ai/free/en/papers/2010/) / Kernel density estimation via diffusion

# Kernel density estimation via diffusion

Paper · 2010 · Zdravko I. Botev, Joseph F. Grotowski and Dirk P. Kroese

**Authors:** Zdravko I. Botev, Joseph F. Grotowski and Dirk P. Kroese · **Year:** 2010 · **Venue:** The Annals of Statistics · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

Cited by **3** papers in our library of more than 163,000 papers whose bibliographies we read · The Annals of Statistics · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1011.2602)
- [DOI 10.1214/10-aos799](https://doi.org/10.1214/10-aos799)
- [arXiv 1011.2602](https://arxiv.org/abs/1011.2602)

## Summary

A sample can suggest several peaks, an asymmetric shape, or a sharp edge without making it clear which of those features belong to the underlying distribution. Kernel density estimation helps by spreading the probability at each observation over a neighborhood. The size of that neighborhood matters. Too little spreading leaves accidental bumps, while too much can erase genuine peaks. The spread can also extend past a known boundary, leaving an estimate that is too low near the edge. Botev, Grotowski and Kroese use diffusion to address these problems within the same estimation framework.

The authors start with an observation about ordinary Gaussian smoothing. Placing a Gaussian kernel at every data point gives the same result as letting probability spread from those points according to the heat equation. On a bounded domain, a reflecting boundary keeps that probability inside. For local adaptation, the authors change the diffusion itself. A preliminary density estimate helps determine how probability moves, making it possible to smooth different parts of the distribution at different rates. The final estimate is non-negative and integrates to unity. The analysis connects particular choices of diffusion to earlier methods that vary the widths or locations of kernels.

The paper also introduces Improved Sheather–Jones, a bandwidth selector that can be used with an ordinary Gaussian estimator. The bandwidth is the amount of smoothing. Existing plug-in rules can estimate it by working through several unknown properties of the density, then using a Gaussian reference distribution to close the calculation. The new rule closes it by seeking a bandwidth consistent with the estimates computed from the sample. The adaptive estimator uses this rule to obtain its preliminary density and help select its own diffusion time.

The simulations distinguish the improvements due to bandwidth selection from the performance of the full adaptive procedure. In a mixture with widely separated peaks, the authors report that the Gaussian estimate using the new selector had one tenth of the integrated squared error of the original Sheather–Jones estimate. The adaptive procedure generally compared favorably with Abramson’s estimator and with a higher-order sinc estimator, with exceptions that depended on the target and sample size. A separate example with uniform data inside an ellipse illustrates how reflecting diffusion handles a known curved boundary. The theory explains why the boundary correction works and how a good preliminary density can reduce the leading bias. The simulations show how those properties can translate into lower error when the preliminary density and bandwidth both have to be estimated.

## Deep dive: Kernel density estimation via diffusion

Kernel density estimation via diffusion uses data-driven smoothing to adapt to local structure and reduce bias at known boundaries. · about 39 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### A density estimate has to resolve structure at the right scale

A density describes how probability is distributed over a continuous domain. Observed values tell us where individual draws landed. To use those observations to assess the shape of the distribution, we need a way to assign probability to the regions between them. The paper motivates this task with questions about multiple peaks and skewness, and with applications such as summarizing posterior distributions, discriminating between groups, and generating draws for the smoothed bootstrap.

A kernel estimate assigns each observation an equal share of probability. It spreads that share around the observed value using a kernel, then adds the contributions. With a Gaussian kernel of fixed width, every contribution has the same shape. The resulting curve reflects the arrangement of the observations as well as the choice of width. A tight group can produce a high peak. A broad gap can produce a valley. The degree to which either is visible depends on the smoothing scale.

There are two competing sources of error. A narrow kernel averages over relatively little data at a given location, so changing the sample can noticeably change the estimate there. A wide kernel averages over a larger neighborhood, making the curve steadier across samples. It also tends to spread mass out of sharp peaks and into valleys. The first issue is variance, the sensitivity of the estimate to repeated sampling. The second is bias, the systematic difference between the average estimate and the underlying density. A bandwidth selector tries to balance the two.

The balance can vary across the domain. A single width may be reasonable around a broad feature and still be too wide for a sharp one. The paper also points out the possibility of isolated observations producing spurious bumps. An adaptive procedure makes it possible to give such an observation a more dispersed contribution while retaining detail where the sample is dense. The resulting estimate still needs to describe a distribution: it should assign non-negative density and preserve total probability.

A known support adds a separate constraint. Suppose all observations lie on the non-negative axis and the density stays substantial down to its endpoint. A Gaussian centered near the endpoint spreads some of its mass into negative values. The estimate receives no corresponding contributions from observations on that side. Near the endpoint, the loss comes from the smoothing rule itself, so it persists in the average over repeated samples. A boundary-aware kernel needs to change the way probability spreads near the endpoint while continuing to smooth usefully in the interior.

#### The earlier approaches addressed different parts of the problem

The paper describes several approaches to adapting kernel estimates. Balloon estimators change the smoothing width with the evaluation location. Nearest-neighbor methods use distances to observations to determine how much local evidence is available. Other variable-bandwidth procedures tie the width to the sample points, often with the help of a preliminary density. Kernel locations can also be adjusted before smoothing, an approach called data sharpening. These methods give the statistician more control over local behavior. The authors emphasize that some lose normalization, and that some sample-point estimators are computationally demanding because the usual fast Fourier transform calculation no longer applies directly.

Higher-order kernels address bias by letting parts of a kernel contribution cancel others. That cancellation can reduce leading error terms, but it allows negative values in the estimate. The paper also cautions that their asymptotic advantages can require large samples to become visible. A boundary correction faces a related difficulty. It can compensate for missing mass near an endpoint while yielding a curve whose integral over the support is different from unity. Other boundary kernels concentrate their adaptation near the edge, leaving the interior smoothing problem to a separate choice.

Plug-in bandwidth selection addresses the choice of scale. Its starting point is an expression for the bandwidth that would give the best large-sample balance if certain properties of the true density were known. One such property is the integrated squared second derivative, a measure of the density’s curvature. In practice the density is unknown, so the selector estimates the curvature and substitutes that estimate into the bandwidth formula. Estimating curvature by smoothing introduces another bandwidth choice. That choice can depend on a higher derivative, generating a chain of related estimation problems.

The paper identifies the normal reference rule as a weak point in the usual way of ending this chain. The rule evaluates a high-order quantity under a fitted Gaussian reference density. The resulting estimate can be reasonable when the shape of the target is close to Gaussian. Where the sample consists of distinct clusters, the spacing between the clusters can dominate the scale of a Gaussian fitted to the full sample. The bandwidth calculation then starts with information about a single broad shape, although the features it needs to resolve are concentrated around individual clusters. The earlier work discussed by the authors uses separated modes to expose this problem.

The idea that a Gaussian kernel estimate can be read as the solution of the heat equation had already appeared in work on scale-space analysis. To construct the estimator, the authors begin with that connection. A diffusion equation can specify how probability moves, which boundaries it respects, and which density remains unchanged under that motion. This gives the paper a common mathematical language for questions that earlier procedures frequently treated separately.

### The method, step by step

#### From a sample of points to a density

The construction begins by treating each observed value as a concentrated deposit of probability. Before smoothing, all the probability lies at the data points. A diffusion moves that probability into their neighborhoods. The time for which the diffusion runs determines how much spreading takes place. At a short time the estimate retains fine detail from the sample. A longer time allows more overlap between nearby contributions. This is a way to construct the density from the observed sample, with a pilot estimate and a bandwidth calculation supplying the quantities needed for adaptive smoothing.

From observed points to an adaptive diffusion estimate The steps in order.

The simplest version of the construction is ordinary Gaussian kernel estimation on the real line. Here the diffusion has constant coefficients, so it treats every starting location in the same way. A point of probability broadens into a Gaussian. By linearity, spreading the entire sample is equivalent to spreading each observation and averaging the results.

```
f̂(x; t) = (1/N) ∑ᵢ₌₁ᴺ φ(x, Xᵢ; t)
```

Here f̂ is the Gaussian density estimate, x is the location at which it is evaluated, t is diffusion time, N is the sample size, and Xᵢ is the observation with index i. The sum runs over all observations. The function φ is the Gaussian kernel.

```
φ(x, y; t) = exp(−(x − y)²/(2t))/√(2πt)
```

Here x is the destination and y is the starting location, which is an observation when the kernel is used in the average. The time t is the Gaussian variance in this formula. Its square root is the Gaussian standard deviation and is the width the paper reports in some examples. The notation exp denotes the exponential function, and π is the circle constant. The exponential term makes contributions smaller with distance from the starting point, while the denominator normalizes the kernel.

The starting configuration is a measure concentrated at the observations, rather than an ordinary smooth function. The paper writes it as an empirical density using point masses. The equation of motion then specifies how the empirical density becomes an ordinary density at positive times.

```
Δ(x) = (1/N) ∑ᵢ₌₁ᴺ δ(x − Xᵢ)
```

Here Δ denotes the empirical measure, δ denotes a unit point mass, and δ evaluated at x minus Xᵢ locates that mass at observation Xᵢ. The index i ranges over the N observations. The factor outside the sum gives every observation the same share of total probability.

```
∂f̂(x; t)/∂t = (1/2) ∂²f̂(x; t)/∂x²
```

Here ∂ denotes partial differentiation. The left side is the rate at which the estimate changes with time t at location x. The right side is half the spatial second derivative of f̂. The initial condition is the empirical measure Δ. The Gaussian kernel is the solution that begins from a single point mass, which explains why the average of Gaussian kernels solves the equation for the full sample.

The equation also explains the effect of increasing the bandwidth. At a local peak, negative curvature lowers the height at that location as the curve evolves. In a valley, positive curvature raises it. For the heat equation on an interval, the authors use the maximum principle to explain why the number of modes does not increase with time. The same scale-space property holds for the ordinary Gaussian estimate on the real line. This argument concerns the heat equation example, where the coefficients are constant.

#### Reflecting probability at a known boundary

On a finite interval the initial sample is the same kind of empirical measure, but the equation evolves it only on the interval. The paper imposes a zero derivative at both endpoints for the heat equation. This is a Neumann boundary condition, a constraint on the spatial derivative at the edge. Here it means zero flow of probability through the boundary. Integrating the heat equation over the interval then shows that its total probability is constant, because the rate of change of the integral depends on the derivatives at the endpoints.

There is a direct kernel expression for this construction on the unit interval. It adds the effects of reflected images of each observation. Near one endpoint, a reflected contribution compensates for the outward spread of the ordinary Gaussian. The repeated images make the correction work at both endpoints of the same interval.

```
κ(x, y; t) = ∑ₖ₌₋∞^∞ [φ(x, 2k + y; t) + φ(x, 2k − y; t)]
```

Here κ is the reflecting heat kernel on the unit interval, x is the evaluation point, and y is the starting point in that interval. The function φ is the Gaussian kernel, and t is the time. The index k ranges over the integers, with the two terms placing Gaussian images at reflected and translated locations. The infinite sum describes the effect of reflection at both ends. The reflecting estimate is the average of κ over the observed starting locations.

At short times and a fixed interior location, the paper finds the same leading kernel behavior as on the real line. The Gaussian spread is then concentrated close enough to the data point that the boundary images have little effect in the interior. Near an endpoint, the added image contributes on the same scale as the original point. This is where the reflecting estimator separates from ordinary Gaussian smoothing.

The paper gives the reflecting heat kernel a second representation. It is a series of cosine modes whose amplitudes decay with time. The constant mode stays fixed as the others decay, so long diffusion on the unit interval approaches a uniform density. The reflection and cosine representations answer different questions about the same estimator. The images explain the short-time correction near the endpoints. The cosine modes explain the loss of detail under very long smoothing.

#### Making the diffusion adapt to the density

The general estimator changes the rate and the direction of movement according to location. It uses two functions. The first, p, is the density the diffusion is designed to preserve. It can be estimated from the sample as a pilot or chosen to express what the statistician knows before seeing the sample. The second, a, works with p to determine local movement. Given these functions and a smoothing time, the evolution is linear in the density being smoothed. This is what allows the estimate to retain the average-of-kernels interpretation.

```
∂g(x; t)/∂t = Lg(x; t)
```

Here g is the adaptive density estimate, x is the evaluation location, t is diffusion time, and L is the forward differential operator that determines how the density evolves. The partial derivative on the left is the local rate of change. As in the heat equation construction, g begins from the empirical measure Δ.

```
Lu(x) = (1/2) (d/dx)[a(x) (d/dx)(u(x)/p(x))]
```

Here L acts on a function u of x. The function p is the positive reference function and a is the positive coefficient controlling the movement together with p. The notation d/dx denotes an ordinary spatial derivative. The inner derivative measures the spatial change in the ratio of u to p. Multiplication by a weights that change, and the outer derivative turns it into a local rate of gain or loss. This form makes the stationary role of p immediate. When u is p, their ratio is constant and the equation leaves the density unchanged.

The general boundary condition sets the spatial derivative of the ratio of g to p to zero at the boundary. The flow then vanishes there, and the total integral of g is preserved. The condition takes this form because a gradient of the ratio is what drives the probability flow. For constant p it becomes the ordinary zero-derivative condition. With nonconstant p, the density itself can have a slope at an endpoint even when its ratio to p has zero slope there.

The same construction can be described by following a single random particle. The particle is initialized at a randomly selected observation. Its motion has a local drift, which gives a systematic displacement, and a local diffusion coefficient, which governs the random part. The density of its position at the stopping time is the density estimate.

```
dXₜ = μ(Xₜ) dt + σ(Xₜ) dBₜ
```

Here Xₜ is the particle position at time t. The increment dXₜ combines drift μ at the current position times the time increment dt with the diffusion coefficient σ times the Brownian increment dBₜ. Brownian motion Bₜ supplies the random fluctuations. The symbol Xₜ here describes an evolving state, whereas Xᵢ in the empirical measure indexes a fixed observation.

```
μ(x) = a′(x)/(2p(x))
```

Here μ is the drift at location x, a′ is the spatial derivative of a, and p is the reference density function. When a is constant, the drift is zero. A spatially changing a can move the centers of the contributions as well as changing their spread.

```
σ(x) = √(a(x)/p(x))
```

Here σ is the diffusion coefficient at x. The ratio inside the square root is the local variance rate of the motion. With a constant a, a smaller pilot value p gives faster random spreading. Conversely, a high pilot value concentrates the local motion. When a equals p, the variance rate is constant and the local adjustment takes place through the drift.

The transition density for this motion is now the kernel. It answers a question about a single observation: given a start at y, what is the density of the particle at x after time t? Averaging those transition densities gives the result for the sample.

```
g(x; t) = (1/N) ∑ᵢ₌₁ᴺ κ(x, Xᵢ; t)
```

Here g is the adaptive estimate, κ is the transition density of the chosen diffusion, x is the destination, Xᵢ is the starting observation with index i, t is the common stopping time, and N is the sample size. A common time can produce different effective widths around different observations because the coefficients depend on position. Each transition density contributes the same amount of total probability to the average.

The paper uses both a forward and a backward equation for κ. The forward equation varies the destination x and applies L to that argument. The backward equation varies the starting point y, treating the destination as fixed. Its operator is the generator of the process, which describes how the expected value of a function of the particle’s position changes just after it starts moving.

```
L* v(y) = (1/(2p(y))) (d/dy)[a(y) (dv(y)/dy)]
```

Here L* is the adjoint of L in the forward and backward equations, v is the function of the starting position y to which it is applied, and a and p are the diffusion coefficient function and reference function used above. The operator differentiates v with respect to y, multiplies the derivative by a, differentiates again, and divides by twice p. For a reflecting boundary, the derivative with respect to y of the backward kernel vanishes there.

The kernel has a reversibility property known as detailed balance. It says that, when starting positions are weighted by p, probability travels between any two locations at the same rate in either direction in the sense given by the transition density.

```
p(y)κ(x, y; t) = p(x)κ(y, x; t)
```

Here x and y are positions in the domain, t is positive time, p weights the starting position on each side, and κ gives the density at the destination conditional on the start. Integrating this identity over starting locations shows why p is preserved under the diffusion. When p is a probability density and the diffusion has the limiting behavior described in the paper, prolonged smoothing approaches p. A pilot therefore influences both the local motion at short times and the shape approached under prolonged smoothing.

The Chapman–Kolmogorov identity gives another account of diffusion time. Evolving to an intermediate time and then evolving again produces the same transition as running continuously for the sum of the two times. One integrates over every possible intermediate position. The authors use this composition property in the bandwidth analysis, where the product of Gaussian-kernel contributions integrated over location can be expressed using a kernel at twice the original time.

For a bounded interval, the paper also gives a generalized Fourier representation of the adaptive kernel. The cosine modes of the heat kernel are replaced by eigenfunctions of the backward operator. The eigenfunctions obey the reflecting boundary conditions, and their orthogonality is measured with weight p. Each mode evolves according to its eigenvalue. This representation makes the connection between the uniform limit of ordinary reflecting heat flow and the pilot-dependent limit of adaptive diffusion. The paper also shows that a class of divergences, which compare the ratio of g to p through a convex function, decreases as diffusion time increases.

#### What short-time behavior says about error

The authors derive a short-time approximation to the diffusion kernel on the real line. Its exponential term has a Gaussian form in a transformed coordinate. In that coordinate, distance accumulates at the reciprocal of the diffusion coefficient. A stretch of the domain where motion is slow represents more distance to the kernel than a stretch of the same length where motion is fast.

```
s(x, y) = ∫ᵧˣ √(p(u)/a(u)) du
```

Here s is the signed distance in the transformed coordinate, y is the start, x is the destination, and u is the integration variable. The integrand is the reciprocal of σ at u, written in terms of p and a. Reversing the locations reverses the sign of s. The kernel approximation uses its square.

```
κ̃(x, y; t) = [p(x)/(√(2πt) [p(x)a(x)a(y)p(y)]¹⁄⁴)] exp(−s(x, y)²/(2t))
```

Here κ̃ is the leading small-time approximation to κ, t is time, x is the destination, and y is the starting position. The functions p and a supply both the local distance through s and the factors outside the exponential. The notation exp denotes the exponential, and π is the circle constant. Under the paper’s conditions, the ratio of κ to this approximation tends to unity as t decreases toward zero. The authors use the approximation to analyze the exact diffusion estimator.

The expected estimate is what would be obtained on average over repeated samples from the true density. Under the conditions of the real-line analysis, it starts from the true density in the same sense that an individual estimate starts from its empirical measure. Its initial rate of change is L applied to that true density, which gives the leading pointwise bias.

```
E_f[g(x; t)] − f(x) = tLf(x) + O(t²)
```

Here E_f means expectation over the sample drawn from the true density f. The estimate g is evaluated at x and t. The symbol Lf means the forward operator applied to f, and O(t²) denotes a remainder of order at most t squared in the short-time analysis. The leading bias is governed by variation in the ratio of f to p through the operator L. That is the mathematical reason a pilot resembling the target can help.

The variance calculation uses the independence of the observations and the short-time kernel approximation. The variance of the average decreases as the sample gets larger. At a fixed location, the way that variance depends on time and local diffusivity follows from the squared kernel, which puts substantial weight on starting positions close to the evaluation point.

```
Var_f[g(x; t)] ∼ f(x)/(2N√(πt) σ(x))
```

Here Var_f is variance over repeated samples from f. The estimate g is evaluated at x and t, N is the sample size, σ is the diffusion coefficient at x, and π is the circle constant. The symbol ∼ indicates leading asymptotic equivalence under the paper’s conditions. With the other quantities held fixed, faster spreading lowers local variance. The leading variance can therefore be different at two locations even when the same time is used throughout.

The global error criterion is the mean integrated squared error, or MISE. It measures disagreement with the true density by squaring the discrepancy at each location, integrating over the domain, and averaging across samples. This separates into integrated squared bias and integrated variance. The authors derive an approximation, called AMISE, from the leading terms of both components.

```
AMISE{g}(t) = t² ‖Lf‖² + E_f[σ(X)⁻¹]/(2N√(πt))
```

Here AMISE is the asymptotic approximation to the mean integrated squared error of g at time t. The squared norm ‖Lf‖² integrates the square of the function Lf over the real line. In the second term, X is a draw from f, σ(X)⁻¹ is the reciprocal of the local diffusion coefficient, E_f averages it under f, N is the sample size, and π is the circle constant. Increasing t raises the leading squared-bias term and lowers the leading variance term. The time used in the adaptive estimate is obtained by minimizing this expression with estimated values in place of the unknown quantities.

The resulting minimum has the same large-sample rate reported for ordinary Gaussian smoothing when the pilot differs from the target and the leading terms are nondegenerate. The adaptive construction changes the multiplicative constant. A pilot close enough to the target can make the bias contribution small. In the ideal case in which p equals f, the ratio inside L is constant and the leading bias vanishes. The authors discuss exact unbiasedness in the smooth stationary case. In an actual estimation problem p has to be supplied or estimated, so this case explains the mechanism by which a good pilot helps.

#### How earlier adaptive kernels arise from the same construction

Constant, equal choices of a and p on the real line recover the ordinary Gaussian kernel. The variance rate is constant, and the drift vanishes. On a bounded interval the same coefficients, together with reflecting boundaries, recover the heat kernel for that interval.

If p is a clipped pilot density and a is constant, the short-time kernel near an observation has the form of a Gaussian with variance proportional to the reciprocal of the pilot evaluated there. Clipping means keeping the pilot away from zero. The local Gaussian standard deviation therefore varies with the reciprocal square root of the pilot. This is the behavior described by Abramson’s square-root law. An observation in a region assigned low density by the pilot produces a broader contribution.

If a equals p, the short-time variance is constant, while the drift involves the derivative of the pilot divided by the pilot itself. The Gaussian contribution is then approximately centered at a shifted location. This is how data sharpening appears in the diffusion framework. The paper also considers choosing a as a power of p. Intermediate powers let the kernel change its location and its width together. These relationships concern the local, short-time form of the diffusion kernel. The final estimator propagates the exact kernel, which can move through regions where the coefficients change.

The authors identify another criterion for choosing the coefficients on the real line. The underlying particle process should be nonexplosive, meaning it should avoid reaching infinity in finite time. They express Feller’s test in terms of a and p and point out that a constant a is a simple way to avoid explosion. This is a regularity consideration for the stochastic construction. For the principal numerical comparison of the adaptive estimator, they instead take a equal to the pilot and use no clipping. That choice makes the diffusion coefficient constant and uses the pilot to determine drift.

#### Selecting the pilot bandwidth without a normal reference

The bandwidth calculation begins with the ordinary Gaussian estimator. Its optimal time in the asymptotic error calculation depends on the integrated squared second derivative of the true density.

```
t* = [1/(2N√π ‖f″‖²)]²⁄⁵
```

Here t* is the Gaussian time that minimizes its asymptotic mean integrated squared error, N is the sample size, π is the circle constant, and f″ is the spatial second derivative of the true density. The squared norm ‖f″‖² is the integral of the squared derivative. The exponent is applied to the entire bracket. A density with more integrated squared curvature calls for a smaller time in this expression.

The computation generalizes to integrated squared derivatives of arbitrary positive integer order. The authors start from an identity between the squared derivative integral and the expected value of a higher derivative at a draw from f. This is an integration-by-parts identity under the relevant regularity conditions.

```
‖f⁽ʲ⁾‖² = (−1)ʲ E_f[f⁽²ʲ⁾(X)]
```

Here j is the derivative order, f⁽ʲ⁾ is the jth spatial derivative of f, and f⁽²ʲ⁾ is the derivative of twice that order. The square of the norm on the left is integrated over the real line. The variable X is a draw from f, and E_f averages the derivative evaluated at that draw. The factor involving minus one accounts for the sign introduced by repeated integration by parts.

The two sides suggest two estimators of the same quantity. One differentiates the Gaussian estimate to the higher order and averages the result at the observed points. The other takes the lower-order derivative of the Gaussian estimate, squares it, and integrates. The authors show that the second calculation is equal to the first with twice the smoothing time. This gives them a way to choose the intermediate time by requiring the two estimators to have the same leading mean squared error.

```
tⱼ* = [(1 + 1/2^(j + 1/2)) (1 × 3 × 5 × ··· × (2j − 1))/(3N√(π/2) ‖f⁽ʲ⁺¹⁾‖²)]^(2/(3 + 2j))
```

Here tⱼ* is the intermediate time for estimating the integrated squared derivative of order j, N is the sample size, and π is the circle constant. The product multiplies the odd integers from the first through the one indexed by twice j minus one. The squared norm ‖f⁽ʲ⁺¹⁾‖² integrates the square of the next derivative of f. The denominator and the outer exponent depend on j. The expression explains the recursion: selecting the time for the derivative of order j requires estimating the derivative quantity of the next order.

In the derivation, averaging derivatives evaluated at the sample points includes terms where the same observation is used as both a kernel center and an evaluation point. These terms contribute to the leading bias at small bandwidths. Smoothing introduces a bias of its own. The paper finds that the leading mean squared error for these functional estimates is governed by squared bias under its asymptotic conditions. Because the two estimates are related by a change in time, their leading errors can be equated to produce the displayed choice.

In the direct plug-in procedure described by the authors, one chooses a recursion depth and estimates the highest derivative quantity from a Gaussian fitted to the sample. Each lower-order stage then uses the time supplied by the previous stage. At the end, the estimated curvature is substituted into the Gaussian bandwidth formula. In this procedure the final time can carry the effect of the Gaussian assumption all the way down the recursion.

Improved Sheather–Jones uses a trial time at the top of the chain, estimates the needed derivative quantities from the sample, and works down to a candidate for the final time. It then seeks a trial value whose output equals its input. This is a fixed point, a value left unchanged by the bandwidth calculation.

```
t = ξγ^ℓ
```

Here t is the candidate Gaussian smoothing time, ξ is the paper’s scaling constant connecting the final Gaussian formula with the derivative-stage time, and γ^[ℓ] denotes the composition of the successive plug-in maps with depth ℓ. Each map uses an estimate from a higher derivative stage to determine the time at the stage below it. The brackets on the superscript indicate composition. The authors report ξ as roughly 0.90.

The proposed iteration starts near zero, at machine precision, applies the mapping, and feeds the resulting time back as the next candidate. It stops when consecutive values differ by less than machine precision. The authors also describe solving the equation by Newton’s method. Their numerical experience leads them to use depth ℓ = 5. They report little practical change from increasing the depth further. A discrete cosine transform provides a fast way to evaluate the repeated Gaussian smoothing calculations. The authors make a Matlab implementation of this bandwidth selector available.

The reference distribution and the kernel have distinct roles here. The Gaussian kernel still determines how probability from an observation is spread in the pilot estimate. The selector learns how much spreading to apply from derivative estimates and the fixed-point calculation. It therefore retains Gaussian smoothing while dispensing with a fitted Gaussian shape at the top of the bandwidth recursion.

#### Selecting the adaptive diffusion time

The adaptive procedure uses the Gaussian estimate as p and carries forward the intermediate time for estimating the integrated squared second derivative. It then specifies a as a power of p, with the exponent chosen within the range described by the authors. This fixes the operator L and the local diffusion coefficient. To select the final time, the procedure needs an estimate of the bias quantity ‖Lf‖² and an estimate of the average reciprocal diffusion coefficient.

```
V̂ = (1/N) ∑ᵢ₌₁ᴺ 1/σ(Xᵢ)
```

Here V̂ estimates the variance coefficient’s expectation E_f[σ(X)⁻¹]. The sample size is N, Xᵢ is observation i, and σ is the diffusion coefficient determined by a and p. The sum averages the reciprocal coefficient at the observed values. The paper presents this as the sample-average estimator for the expectation in the adaptive error formula.

The authors discuss two ways to estimate ‖Lf‖², paralleling the Gaussian calculation. The practical algorithm applies L to a smoothed estimate, squares the result, and integrates it. The diffusion equation equates L applied to the estimate with its time derivative, which means the numerical solver already supplies the inputs for a finite-difference calculation.

```
‖Lg(·; t)‖² ≈ ‖g(·; t + ε) − g(·; t)‖²/ε²
```

Here L is the forward operator, g is the diffusion solution, and the dot means that the functions range over the spatial domain when their squared norms are evaluated. The time t is the intermediate time for estimating the bias quantity, and ε is a small time increment. The expression uses the change in the density between nearby solver outputs to approximate a squared time-derivative norm. The simulation implementation uses finite differences and Matlab’s stiff equation solver `ode15s.m`. The paper also identifies spectral methods as a way to solve the diffusion equation.

The analysis derives a separate optimal intermediate time for the adaptive functional. The implemented algorithm approximates it using the intermediate Gaussian time already computed by Improved Sheather–Jones. The paper gives a reason for this substitution: the two times have the same convergence rate, and they agree in the Gaussian special case. This makes the adaptive bandwidth calculation a single plug-in stage after the Gaussian pilot. The final estimate evolves the original empirical measure to the selected adaptive time, using the pilot to determine the motion.

The paper also describes how to obtain a draw approximately distributed according to the diffusion estimate. It picks an observation uniformly as the starting point, subdivides the selected diffusion time, and uses Euler steps to update the particle. Each step combines a drift increment with a Gaussian increment scaled by the current diffusion coefficient. The final particle position is the approximate draw. For the reflecting heat kernel on an interval, the authors describe a more direct construction based on adding Gaussian noise to the starting observation and folding the result into the interval.

#### Extending the bandwidth calculation to two coordinates

The paper gives a two-dimensional Gaussian bandwidth selector based on the same fixed-point idea. The curvature quantities now include pure derivatives along each coordinate and a mixed derivative. At each level of the recursion, a derivative quantity depends on quantities one order higher in either coordinate. The method starts a trial time at a common total derivative order and works downward until the curvature terms needed for the final bandwidth have been estimated.

```
t* = [2πN(ψ₀,₂ + ψ₂,₀ + 2ψ₁,₁)]⁻¹⁄³
```

Here t* is the optimal time in the paper’s asymptotic formula for the two-coordinate Gaussian kernel with a common smoothing parameter. The sample size is N, π is the circle constant, and ψ with two subscripts denotes an integrated squared partial derivative. The subscripts specify the derivative orders in the respective coordinates. The mixed-derivative term appears with the displayed weight. The negative exponent applies to the full bracket.

```
ψᵢ,ⱼ = ∫ℝ² [(∂^(i+j) f(x))/(∂x₁^i ∂x₂^j)]² dx
```

Here ψᵢ,ⱼ is the integrated squared derivative, i and j are the orders of differentiation along coordinates x₁ and x₂ of the location vector x, and f is the true density at x. The integral is over the two-dimensional real space ℝ², with dx denoting integration over both coordinates. The partial derivative treats each coordinate separately as indicated by its order. A zero order in one coordinate corresponds to differentiating only along the other.

As in the univariate case, the authors compare an estimator built from sample averages of higher derivatives with one built from an integrated squared derivative. The estimated curvature terms then give a new candidate for the smoothing time. The method seeks a time that maps to itself. The authors report good numerical results with starting total derivative orders k = 4 or k = 5. The Matlab implementation uses a two-dimensional discrete cosine transform and can use the estimated curvature terms to calculate separate entries of a diagonal bandwidth matrix. The separated-cluster demonstration uses the common smoothing parameter.

### Experiments and results

#### Comparing bandwidth selectors with the kernel held fixed

The first comparisons use Gaussian kernel estimates. They change the bandwidth rule and assess how closely the resulting estimate matches a known simulation target. This setup keeps the kernel and error criterion comparable across rules. Differences between the curves directly illustrate the consequences of choosing a different amount of smoothing.

The paper begins with a mixture of Gaussian components with means −30 and 30 and a common variance of 1. The figure shows the right peak. The authors report similar behavior at the left peak. With the original Sheather–Jones bandwidth, the estimate smooths over detail that the new bandwidth retains. The integrated squared error of the Improved Sheather–Jones estimate is reported as one 10th of the error from the original bandwidth rule. The component separation in this example makes the overall spread of the data a poor guide to the width of the individual peaks.

The larger univariate study compares Improved Sheather–Jones with the original Sheather–Jones selector across simulated target densities on the real line. It reports averages over 10 independent trials. The test densities include shapes with several peaks, skewness, and features of very different widths. The criterion divides the integrated squared error of the Gaussian estimate using Improved Sheather–Jones by the corresponding error using original Sheather–Jones. A ratio below unity favors the new selector. The paper reports this relative error for each target and sample size.

Improved Sheather–Jones relative to original Sheather–Jones on simulated univariate densities The new selector has the clearest advantages on the separated or more strongly multimodal targets shown.

**The numbers**

| System or setting | Integrated squared error ratio |
| --- | --- |
| Claw, N = 10³ (this paper) | 0.72 |
| Claw, N = 10⁴ | 0.94 |
| Separated bimodal, N = 10² | 0.33 |
| Separated bimodal, N = 10³ | 0.64 |
| Trimodal, N = 10² | 0.21 |
| Trimodal, N = 10³ | 0.17 |
| 5-modes, N = 10² | 0.07 |
| 5-modes, N = 10³ | 0.18 |

The separated bimodal target favors the new selector at both sample sizes shown, while the claw comparison moves much closer to parity at the larger sample size. The trimodal results remain well below unity at both sizes. These results show that similar sample sizes can give very different relative errors depending on density shape. They also distinguish two kinds of interpretation. A ratio near unity means the methods have similar error for that setting. The absolute error of either estimate would require its own measurement.

The table also has settings in which original Sheather–Jones does as well or slightly better. On the skewed bimodal target, the reported ratios are 1.02 for N = 10³ and 1.00 for N = 10⁴. For the outlier target, the corresponding ratios are 1.01 for N = 10³ and 1.00 for N = 10⁵. Removing the reference calculation gave the largest gains in a subset of the test shapes. The small deviations from parity in other cases put those gains in perspective.

In the two-dimensional bandwidth experiment, the target is a mixture with component centers at (0, 0), (0, 50), (50, 0), and (50, 50). Each component has identity covariance, and the sample contains 400 observations. The Gaussian kernel uses a diagonal covariance with a common smoothing parameter. The baseline selects that parameter with a normal reference rule. The comparison is visually clear in the paper: the reference rule produces excessive smoothing even though the component clusters are far apart. The authors report that the integrated squared error using Improved Sheather–Jones is 10 times smaller than the error using the reference rule. This comparison extends the separated-cluster result to a setting where separation occurs along both coordinates.

#### Comparing the full adaptive procedure with other estimators

The main univariate adaptive comparison uses the diffusion estimator with α = 1, so a equals the Gaussian pilot. The pilot comes from the sample, and the authors use its values without clipping. They also estimate the final smoothing time from the sample. This matters because some of the earlier simulation studies they discuss supplied adaptive estimators with the true density or true derivative quantities and selected bandwidths by minimizing exact mean integrated squared error. The experiments here use the known target to score the estimates after fitting.

The first baseline is Abramson’s adaptive estimator. It computes local widths from pilot values at the data points, scaled using their geometric mean. Its bandwidths are chosen by least-squares cross-validation. Cross-validation supplies a data-based smoothing choice for that procedure. The second baseline uses a higher-order sinc kernel, again with least-squares cross-validation to select the smoothing width. Because the sinc kernel has negative regions, its estimate can take negative values.

The study again uses 10 independent simulation experiments and treats the support as the real line. It reports two ratios. Ratio I divides the adaptive diffusion estimate’s integrated squared error by Abramson’s. Ratio II divides it by the sinc estimate’s integrated squared error. Each ratio has its own denominator. A smaller value in one column indicates a stronger advantage relative to that particular baseline.

Diffusion relative to Abramson on the bimodal mixture and claw density The diffusion procedure has lower relative error at the larger sample size for both targets shown.

**The numbers**

| System or setting | Integrated squared error ratio |
| --- | --- |
| Bimodal mixture, N = 10³ (this paper) | 0.9 |
| Bimodal mixture, N = 10⁵ | 0.23 |
| Claw, N = 10³ | 0.65 |
| Claw, N = 3 × 10⁵ | 0.11 |

For the same bimodal mixture, the ratio against sinc is 0.82 at N = 10³ and 0.48 at N = 10⁵. For the claw, the ratios against sinc are 0.99 at N = 10³ and 0.51 at N = 3 × 10⁵. These comparisons illustrate why the authors report both baselines. An adaptive estimate can gain substantially over one comparator and stay relatively close to another for the same data configuration.

The table includes settings where diffusion has the larger error. In the strongly skewed setting at N = 10³, Ratio I is 1.05, while Ratio II is 0.75. The diffusion estimate has higher error than Abramson’s there and lower error than the sinc estimator. In the discrete comb setting at N = 10³, Ratio I is 0.54 and Ratio II is 2.24. In that setting Abramson’s estimate has higher error than diffusion and sinc has lower error. At N = 10⁵ for the same target, the ratios are 0.12 and 0.84. The change across sample sizes makes the comparison of the complete estimation procedures more informative than a ranking based on the most favorable row.

The authors interpret the larger-sample results as evidence that their tested diffusion procedure can perform well without clipping the pilot. They also take the sinc comparison to illustrate the difference between higher-order asymptotic bias properties and accuracy at the sample sizes used in an experiment. The density constraint remains relevant even on a target for which sinc achieves lower squared error. Applications that draw from an estimated density depend on the curve being a valid probability density as well as a close approximation.

#### Examining boundary correction on bounded domains

The first boundary illustration uses a beta density on the unit interval. It falls from a high value at the left endpoint towards the right endpoint. The authors draw N = 1000 observations and give the ordinary Gaussian estimate and the reflecting heat estimate the same bandwidth, reported as a square root of time of 0.05248. The Gaussian curve near the left endpoint is close to half the target density there, in keeping with the boundary calculation. The reflecting estimate is visibly closer to the target. Because the two methods use the same width, the figure isolates the effect of reflection in this sample.

A later comparison uses a polynomial boundary correction developed by Hall and Park. It includes an exponential target with mean equal to unity and a collection of targets from the earlier simulations, truncated above at 0. The upper limit is treated as known. Hall and Park’s construction adjusts for the loss of kernel mass near the endpoint and preserves positivity. The authors choose its bandwidth by least-squares cross-validation and compare the resulting integrated squared errors with those of the diffusion estimator. The ratio for the exponential target is 0.52. The ratios for the truncated cases also favor diffusion in this experiment, with values including 0.25 and 0.74. The paper describes the finite-sample performance as competitive and notes that the Hall and Park estimate does not in general integrate to unity.

The curved-domain example uses 600 independent points distributed uniformly inside an ellipse. The support is assumed known. The authors solve the heat equation on the ellipse and impose zero normal derivative along its boundary. The normal direction points directly outward from the ellipse, so this condition restricts flow across the actual curved edge. They use their two-dimensional bandwidth procedure to select a diffusion time of 0.13. The figure illustrates that the density remains well behaved near the boundary, where unconstrained smoothing would spread mass outside the support. This example adds geometric evidence to the numerical comparisons on intervals and half-lines. The paper presents it through the estimated surface, without an accompanying error ratio against another method.

### What the ablations show

The paper has no formal ablation suite, but it offers controlled comparisons and mathematical analyses that distinguish the effects of bandwidth selection, local diffusion, and boundary conditions.

#### A better time can improve the same Gaussian estimate

The original and Improved Sheather–Jones comparisons come closest to a direct test of a single design choice. Both methods use Gaussian smoothing and estimate the same target from the same kind of sample. The changed component is the bandwidth rule. The examples with separated modes are especially informative because the source of difficulty is visible in the geometry. Most observations lie in clusters, while the total spread includes the gap between clusters. The reference-based procedure can pick a time that is too large for the within-cluster shapes. The fixed-point selector derives the time from the sample-based derivative calculations and better resolves those shapes in the examples.

The comparison tests two complete bandwidth rules, because eliminating the Gaussian reference also changes how the recursion is closed. It supports the claim that the new way of closing the recursion can improve the final estimate. It does not separately measure every choice made within the iteration. The authors do vary the depth in numerical trials. They find that extending the recursion past their chosen depth of ℓ = 5 yields practically similar solutions. This suggests that the gains they observe do not require pushing the method to ever higher derivative stages.

#### One diffusion can change character as time increases

An illustration with N = 500,000 draws examines the shape of the solution as diffusion time varies. The sample comes from a density on the unit interval that oscillates according to a cosine. The reference density is the decreasing beta density used in the earlier boundary example, and a is constant. Thus the reference and the sampling density have different shapes by construction. The square roots of time reported for the two curves are 4 × 10⁻⁴ and 0.89.

At the smaller width the estimate still tracks the recurring peaks and valleys of the sampling density. The curve shows more local noise near the left, where the reference density is high and the local diffusion coefficient is low. Toward the right, a lower reference density allows faster spreading, and the estimate is smoother. At the larger width, the solution is visually indistinguishable from the reference density. The example separates the local role of the reference in short-time smoothing from its long-time role as the stationary limit.

The mathematical special cases make the same distinction in terms of location and scale. Keeping a constant while varying p changes the effective local widths without drift. Setting a equal to p produces drift with constant local variance. Letting a be an intermediate power gives both effects. This analysis identifies which coefficient choices produce each contribution. The main numerical study compares the full diffusion procedure against other estimators, so its error ratios reflect the combined choices of pilot, bandwidth rules, and kernel. They do not quantify the contribution of drift on its own.

#### Reflection changes the asymptotic error near the edge

The boundary analysis compares expected estimates when the evaluation point is at or near a known endpoint. With an ordinary Gaussian kernel, the expected density at the left endpoint tends to half the true endpoint value when that value is positive. Shrinking the bandwidth still leaves the Gaussian contribution split between the supported side and the unsupported side. Reflection compensates for this deficit. The authors prove that the expected value of the diffusion estimate approaches the true value for locations moving toward the boundary at the rate of the bandwidth under their conditions.

```
E_f[g(x_N; t_N)] = f(x_N) + O(√t_N)
```

Here E_f averages over samples from f, g is the diffusion estimate, and x_N is an evaluation location near the endpoint at sample size N. The time t_N decreases as N increases. The term f(x_N) is the target density at the same location, and O(√t_N) bounds the order of the remaining bias. The result concerns the half-line analysis and includes the endpoint itself. It quantifies the shrinking bias that the fixed-bandwidth beta comparison illustrates in a finite sample.

The real-line bias and variance analysis gives a separate account of interior performance. A pilot that is close to the target can reduce the rate at which the expected density moves away from the target. The variance depends on how far individual contributions spread locally. The two effects can favor different coefficient choices. The paper’s analysis explains the balance that enters the adaptive bandwidth formula without assuming that the same local rule is optimal for every density.

### Limitations

#### Limits the authors identify

The bandwidth and error calculations are asymptotic. The real-line analysis assumes a smooth density and a sequence of diffusion times that tends to zero while the effective sample size in a shrinking neighborhood grows. The short-time kernel analysis also imposes regularity and tail conditions on the functions that govern the diffusion. The authors give examples of choices that meet these conditions and discuss keeping a pilot away from zero. Their proof under the milder conditions establishes the leading short-time approximation. The validity of the higher-order terms under those same conditions is left open.

The fixed-point algorithm’s convergence and apparent uniqueness are reported as numerical experience. The authors found that their iteration reached a root, that the root appeared unique, and that further stages yielded little practical change. Those observations support the settings used in the computations. They leave open how convergence and uniqueness depend on the sample or target outside the tested settings.

The theoretical bias advantage depends on the choice of stationary density. In the ideal case, the mean estimate starts from the stationary density and remains there. With a pilot estimated from finite data, the amount of improvement depends on how well its shape represents the target and how its derivatives enter the operator. The paper’s generic asymptotic rate remains the Gaussian rate when the leading terms are nondegenerate. The improvement is in the leading constant, which can be small with a good pilot. For heavy-tailed distributions the authors identify cases where the Gaussian or diffusion-based smoothing used here may be a poor fit and suggest other process families as future work.

The boundary examples depend on knowledge of the support. The Hall and Park comparison supplies the truncation point in advance. The elliptical example supplies the entire boundary. The numerical diffusion problem can then enforce reflection on that boundary. The paper establishes what a specified domain can do for the estimate and leaves the task of learning the boundary outside those experiments.

#### What the experimental setup leaves unresolved

The relative-error studies use simulated data with known targets, so integrated squared error can be measured directly. They cover a range of shapes and sample sizes and report averages over repeated trials. The reported ratios do not include measures of trial-to-trial variability. The size of an advantage in a given row therefore describes the reported trials and setting, without establishing how consistently the observed ranking would recur on fresh samples from that target.

The adaptive comparisons use different bandwidth selection procedures for the different estimators. That choice reflects a practical comparison between complete data-driven methods. It also means that the error advantage can depend on the pilot, the final bandwidth selector, and the diffusion kernel together. The principal study uses α = 1 without clipping. It does not map out how the rankings would change over the available powers of the pilot or when each procedure is tested with a common way of choosing its bandwidths.

The multivariate evidence concerns two specific two-dimensional settings. The separated mixture tests a scalar bandwidth for Gaussian smoothing, while the ellipse tests heat diffusion on a known curved domain. The latter shows the behavior of one estimated surface, with no numerical baseline in that example. Together these demonstrations cover a bandwidth problem on the plane and a boundary problem on a supplied domain. Accuracy, numerical cost, and choice of local coefficients for more general multidimensional problems remain open.

The method can produce a mathematically normalized density because its kernels are transition densities and the boundary conditions preserve probability. Practical implementations solve or approximate the evolution equation numerically. The reported experiments give examples using finite differences, and the paper explains how to approximate a derivative norm using nearby solver outputs. The error ratios do not measure how much numerical discretization contributes to the total estimation error. They evaluate the procedure as implemented for the reported settings.

### What came after

The paper ends with research directions for extending the connection between stochastic motion and density estimation. The authors propose constructing kernels from Lévy processes, with the diffusion estimator included as a special case. Their motivation is that a different spreading process could better match heavy-tailed data in settings where Gaussian or diffusion smoothing is poorly suited to the target. This is a proposed extension, with no follow-up results reported in the paper.

A second direction is to make the evolution nonlinear. In the estimator studied here, the pilot sets the diffusion coefficients before the empirical measure evolves. The authors suggest an equation whose local diffusivity depends on the current estimated density, so adaptation would occur during smoothing. They also describe an equation expressed through the logarithm of the density and identify a Cauchy density as a particular solution. That solution motivates considering the equation for heavy-tailed data. Both proposals would remove the separate pilot run at the cost of a more complex evolution. The paper leaves their practical accuracy, bandwidth selection, and numerical behavior for future study.

## Cite

Cite as Zdravko I. Botev, Joseph F. Grotowski and Dirk P. Kroese. 2010. Kernel density estimation via diffusion. The Annals of Statistics.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1214/10-aos799](https://doi.org/10.1214/10-aos799) · [arXiv 1011.2602](https://arxiv.org/abs/1011.2602)

```bibtex
@article{botev2010kernel,
  title = {{Kernel density estimation via diffusion}},
  author = {Zdravko I. Botev, Joseph F. Grotowski and Dirk P. Kroese},
  journal = {The Annals of Statistics},
  year = {2010},
  doi = {10.1214/10-aos799},
  eprint = {1011.2602},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1214/10-aos799}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
