If the unknown probability distribution is supported on , an ordinary Gaussian density kernel still puts some fitted probability below zero. For positive observations and the standard normal distribution cumulative distribution function , the displayed formula gives the total leakage. For the statistical sample and smoothing bandwidth , it is
Thus about of the fitted probability falls outside the known support of a probability distribution, even though the full integral remains one. The leakage panel in smoothing bandwidth shades this area. Simply deleting the negative part leaves area ; renormalizing it makes another probability density function but does not by itself establish that the bias of an estimator has been corrected.
The issue also appears in the expectation of the kernel density estimator. For a nonnegative symmetric kernel for density estimation and a probability density function that is zero for and has a finite positive right-hand limit , assume is bounded. Then, for fixed as ,
Half the averaging window lies on the impossible side of the boundary. For example, the rate-one exponential distribution has , so the limiting expected boundary height is , rather than the right-hand height one. This refers to estimating the right-hand limit; changing a probability density function at a single point does not change its probability distribution. Decreasing the smoothing bandwidth narrows the affected region but does not remove this boundary-height error. This is why the interior second-order pointwise bias bound for kernel density estimation cannot be applied across a jump at the boundary.
Canonical kernel for density estimation Created 2026-10-14 Updated 2026-11-05
For a nonnegative symmetric unit-integral kernel for density estimation with and , the canonical scaling satisfies . Since and , the unique scale is . Consequently its asymptotic mean integrated squared error is , where is invariant under kernel rescaling. The leading optimal smoothing bandwidth becomes , independent of the kernel shape. Unit second moment is a different normalization and does not have this separation property.
Diagonal correction for a quadratic density derivative estimate Created 2026-10-07 Updated 2026-11-05
Let be an independent and identically distributed sample from probability density function , take and , and write . Assume the kernel for density estimation has square-integrable second derivative. Define
This U-statistic obeys whenever differentiation and the displayed integrals are justified. Under the usual convolution regularity this is .
The exact relation to the second derivative kernel density estimator is
Indeed, expand the square into ordered pairs; its diagonal terms are all . Both subtracting this diagonal and changing the normalization from to are needed for the displayed U-statistic. This removes the diagonal sampling contribution, while retaining smoothing bias of an estimator relative to . The corrected value can be negative in a finite sample even though its target is nonnegative.
Epanechnikov kernel Created 2026-10-14 Updated 2026-11-05
The Epanechnikov kernel for density estimation is a nonnegative symmetric truncated parabola with integral one, , and . It has the smallest optimized asymptotic mean integrated squared error among nonnegative second-order density kernels, up to rescaling. Its canonical kernel has scale and support .
Choose a real even smooth compactly supported Fourier transform equal to one near zero and let be its inverse Fourier transform. Repeated integration by parts makes a Schwartz function. It is real, integrable and square-integrable, with unit integral. Moment differentiation of the Fourier transform gives for every positive integer . Such a kernel for density estimation therefore satisfies arbitrary finite-order moment cancellation, and necessarily takes negative values. If the transform plateau contains the frequency support of a bandlimited function , the convolution theorem proves .
Gaussian density kernel Created 2026-10-14 Updated 2026-11-05
The Gaussian density kernel is the standard normal probability density used as a unit-integral kernel for density estimation. Its second moment is one and . Its canonical kernel has scale . It is a function of one smoothing displacement, distinct from the two-argument Gaussian kernel used as a positive-semidefinite kernel.
Integrated second-order kernel bias bound Created 2026-10-07 Updated 2026-11-05
For a nonnegative symmetric unit-integral kernel for density estimation and , the integral Taylor remainder and Minkowski inequality give . Translation preserves the L2 norm. For a signed kernel the same proof requires the absolute moment .
For the unit-width symmetric box kernel for density estimation, suppose the design density is positive and differentiable at , the regression function is twice differentiable there, and the conditional variance and design density are bounded near . Write . Symmetry cancels its linear Taylor term, giving ; independence gives . The absolute error bound for a ratio estimator with a controlled denominator gives the displayed rate if the small-denominator contribution is negligible. The balance gives . Interior design positivity matters: support boundaries can prevent the linear cancellation.
Kernel density estimation Created 2026-09-24 Updated 2026-10-14
Let be real independent and identically distributed random variables with unknown probability density function , let , and choose a nonnegative, unit-integral kernel for density estimation and a smoothing bandwidth . The kernel density estimator is
Place a bump at every observation and add their contributions. Each bump has area , so for every realized statistical sample
The change of variables is . Summing the unweighted bumps would give area ; summing just would give area . Those raw sums do not have the normalization of a probability density function.
Unlike a histogram, the construction does not require choosing bin origins, and a Gaussian density kernel gives a smooth curve. Its appeal is that identical local contributions can combine into a probability density function with several peaks without first choosing their number. This makes kernel density estimation useful for exploring an unknown probability distribution and estimating interval probabilities, while the smoothing bandwidth controls how much detail is visible.
Figure 1.
Three Gaussian contributions, each of area one third, add to a normalized kernel density estimate
. Details.
Before the statistical sample is observed, is a random function; afterwards it is a fitted probability density function. It is an estimator of the unknown , not the true probability distribution. For fixed , its expectation is the convolution , generally different from , and repeating the sampling changes the fitted curve. The exact mean integrated squared error of a kernel density estimator separates this smoothing bias of an estimator from sampling variance. Allowing signed kernels of order ell retains the formula but can lose nonnegativity.
Kernel of a U-statistic 2026-10-14
A U-statistic kernel is an integrable function of a fixed number r of observations whose expectation is the parameter functional to be estimated. Exchangeability permits symmetrization without changing that expectation. This is a function of r sample values, rather than the one-displacement kernel for density estimation.
Kernel of order ell Created 2026-09-24 Updated 2026-11-05
In kernel density estimation, an integrable kernel for density estimation is normalized by . A common exact-order convention calls it a kernel of order ell when, for a positive integer ,
Some authors say order at least without the nonzero final signed moment condition. Stating the convention makes clear whether the first surviving Taylor expansion term is actually of order or merely bounded by that order.
A symmetric Gaussian density kernel has order two: its first moment is zero and its second moment is one. A nonnegative ordinary probability density function cannot have zero second moment unless it is concentrated at zero, which no integrable density can do. Hence kernels with the first two moments zero must take both signs. These higher-order kernels can reduce smoothing bias of an estimator, but the resulting estimate need not itself be nonnegative.
For normalized Legendre polynomials, this kernel for density estimation reproduces evaluation at zero on every polynomial of degree below : expand in the orthonormal basis to obtain . Taking monomials proves integral one and zero moments of orders ; compact support gives finite absolute moments. If exact order requires a nonzero moment of order , add . Lower moments remain unchanged. Writing and evaluating the full expansion of at zero shows that the new moment is . A useful three-derivative example is , whose first two moments vanish and whose squared L2 norm is .
Nonparametric statistics Created 2026-09-24 Updated 2026-10-18
Nonparametric statistics studies statistical inference without restricting the unknown probability distribution or target function to a fixed finite-dimensional parametric statistical model. In density estimation and nonparametric regression, the number of features that an estimator can represent may grow with the sample size. Rank tests offer another approach: the probability distribution of their test statistic under the null hypothesis can be obtained without specifying the common continuous probability distribution.
"Nonparametric" does not mean free of assumptions or tuning choices. A kernel density estimator still requires a kernel for density estimation and a smoothing bandwidth, and its interpretation depends on assumptions about the statistical sample. The freedom is useful when a prescribed shape, such as a single normal distribution, would hide features that the observations might reveal.
Optimality of the Epanechnikov kernel Created 2026-10-14 Updated 2026-11-05
Fix the second moment . Put and . For every nonnegative unit-integral kernel for density estimation with the same second moment and finite , the mass and second-moment constraints give . Outside , and , so . Expanding the square gives , with equality only when almost everywhere. Since is scale invariant, rescaled Epanechnikov kernels minimize the optimized asymptotic mean integrated squared error over all such second moments. This conclusion concerns nonnegative second-order kernels; signed higher-order kernels obey a different bias expansion.
A kernel for density estimation is an integrable function K of unit integral, ordinarily nonnegative and centered. Square integrability is needed for integrated variance; a symmetric second-order kernel for density estimation also has and finite nonzero second moment . Its scaled form is , and the kernel density estimator is
Higher-order signed kernels are possible, but need not give a nonnegative probability density function estimate.
The mean integrated squared error is . Put . Independence gives the pointwise mean and variance . Integrating, use and Fubini to obtain . The bias-variance decomposition proves the exact formula
Equivalently this is . These identities assume the displayed integrals are finite; they are exact, rather than a small-smoothing bandwidth expansion.
For a symmetric second-order kernel for density estimation, Taylor expansion gives leading bias , and the leading integrated variance is . Thus the asymptotic mean integrated squared error balances inverse smoothing bandwidth against fourth-power bias, with optimal smoothing bandwidth . Its appearance of the integrated squared density curvature motivates the scale comparison.
For , , two differentiations give . A change of variables therefore gives , which tends to zero as if the original curvature integral is finite. The distribution with probability density function is that of X divided by a, so . Consequently
This scale-invariant density curvature measures shape without dependence on the units used to measure X.
For the final minimization, write and use the triweight kernel on , zero outside. Integration gives total mass one, mean zero and variance . Its value and its first two derivatives vanish at both endpoints, so its extension is twice continuously differentiable. On the interior,
In particular and .
Put . The mass and moment constraints give , since both means vanish and their variances match. If the claim is immediate; otherwise expand the squared norm and integrate its cross term twice by parts over . The first endpoint term vanishes because , but the next one must be retained:
For the second equality use the zero mass and second moment of e and outside the support. All terms in the last expression are nonnegative, including the endpoint values of a probability density function. It follows that
This proves that the triweight density minimizes integrated squared curvature under the specified constraints. Equality forces ; a globally affine integrable difference of probability density functions is zero, so equality occurs only at .
Assume a symmetric second-order probability density function kernel for density estimation and enough smoothness for the displayed derivative functionals. The benchmark smoothing bandwidth is , balancing against . Three widely used selection methods are as follows.
For least-squares density cross-validation, expand integrated squared error as . Estimate the middle integral by leaving out the observation at which the estimate is evaluated, and minimize
The left-out observation is independent of its estimator, so the second term has expectation . Thus exactly. The subtraction of the self-contribution is essential. Computation uses , where . This method directly targets integrated error without estimating a curvature functional first. Under standard smoothness and a suitable search interval its selected smoothing bandwidth is ratio-consistent with the MISE optimum, and hence with . Relative fluctuations are ordinarily , so the selected values can be quite variable in finite samples.
For biased density cross-validation, estimate curvature from the second-derivative probability density function estimator and subtract its diagonal variance term:
Differentiating the kernel for density estimation estimator and applying the integrated-variance identity gives the exact expectation . Under the derivative regularity assumptions, , so . Minimize BCV over a reasonable smoothing bandwidth range. It is a smoothed criterion directed at AMISE; the name reflects its finite-sample bias rather than an exact unbiased-risk identity. Standard conditions again give ratio consistency and relative fluctuation order . It often has a smoother objective than ordinary least-squares cross-validation, though numerical behavior and relative variance depend on the probability density function and kernel for density estimation.
For plug-in bandwidth selection, obtain an independent pilot scale g, estimate , then set
The pilot should be positive and stable; consistent positive estimates make this expression ratio-consistent by continuity. A simple normal-reference initialization uses under a normal reference model, substituting a sample scale for sigma. For a Gaussian density kernel this gives . A pure normal-reference rule is quick but is asymptotically correctly calibrated only when its assumed curvature matches the actual probability density function; it is useful as the first stage of a data-driven plug-in procedure.
A more adaptive fourth-derivative pilot estimate of density curvature uses , obtained by two integrations by parts, and estimates it by
The diagonal expectation contributes ; the leading smoothing bias is . Balancing these terms produces the stated pilot scale , with another pilot or reference model supplying . Under sufficient derivatives and tail control, its error is bounded by
at that pilot scale. Taylor expansion of the fifth-root formula gives , so it inherits that bound. A calibrated cancellation of leading pilot bias can give a faster rate. This illustrates why an appropriately constructed plug-in selector can converge more quickly than cross-validation, while requiring more smoothness and pilot choices. For each ratio-consistent method, its attained AMISE divided by the minimal AMISE tends to one.
In kernel density estimation, take a kernel for density estimation that is nonnegative, symmetric, and has integral one, finite , and finite . Its smoothing bandwidth gives and the kernel density estimator
from an independent and identically distributed sample with probability density function . Nonnegativity and unit mass make the estimate itself a probability density function. We compare kernel for density estimation shapes by their optimized mean integrated squared error, rather than by their performance at an arbitrarily common numerical smoothing bandwidth.
For the usual second-order theory, assume, for example, that belongs to the Sobolev space and , and let , . The expectation is the convolution . The vanishing first moment of the symmetric kernel for density estimation and the integral Taylor remainder give
Continuity of translations in the L2 norm, with domination by , shows that in the L2 norm. Hence the integrated squared bias of a kernel density estimator is
By independence, the exact integrated variance of a kernel density estimator is
Indeed the integrated second moment of a single summand is , and its integrated squared mean is . The latter quantity is bounded by , by Young's convolution inequality, so its contribution is . The bias-variance decomposition of mean squared error therefore yields the leading criterion
This asymptotic mean integrated squared error displays the bias-variance tradeoff: a small smoothing bandwidth increases integrated variance, while a large one increases squared bias of an estimator.
Differentiating the asymptotic mean integrated squared error with respect to gives . It changes sign once, from negative to positive, so its unique minimum is
At this minimum the integrated variance term is four times the squared bias of an estimator term. Substitution gives
Thus the leading rate is , and the shape comparison reduces to minimizing .
There is an essential scale ambiguity: if , then . Changing the scale of the kernel for density estimation merely changes the numerical convention for the smoothing bandwidth. Moreover
A comparison at the same raw is therefore not a fair comparison of shape. One can normalize the second moment to one, but that does not make the optimal smoothing bandwidth independent of shape.
The canonical kernel for density estimation instead chooses the unique scale
It satisfies , and so
Consequently all canonical kernels share the same leading optimal bandwidth . Only the multiplicative constant depends on shape. This is precisely the separation of shape choice and scale choice that makes the canonical kernel normalization useful. For an original unscaled kernel for density estimation, its corresponding optimal smoothing bandwidth is .
To prove optimal shape, scale a candidate kernel for density estimation to have second moment one. Let and
Direct integration gives , , and . Thus is a rescaled Epanechnikov kernel. For any admissible with the same mass and second moment,
Outside , and , because . The integral inside is therefore nonnegative, and multiplying by gives . Expanding the square now proves
Equality forces almost everywhere. At fixed second moment, minimizing is equivalent to minimizing . Since is scale invariant, this proves the optimality of the Epanechnikov kernel over all nonnegative symmetric second-order kernels for density estimation, including the equality case up to rescaling.
In its usual scale, the optimal Epanechnikov kernel is
Its canonical scale is , giving
The optimal Epanechnikov kernel shape is therefore a truncated parabola, rather than a particular support radius. The canonical kernel and unit-second-moment version represent the same shape but different scale conventions.
The numerical gains over other reasonable kernels for density estimation are modest. Define asymptotic relative efficiency against the optimal Epanechnikov kernel by the sample-size fraction giving the same optimized leading mean integrated squared error:
For the Gaussian density kernel , and , so its efficiency is . For the uniform smoothing kernel , and , giving efficiency . The Gaussian density kernel is infinitely smooth, whereas the optimal Epanechnikov kernel has compact support and allows each observation to affect only a finite window. Such computational and smoothness considerations may outweigh a small leading-efficiency difference.
In practice is unknown. A plug-in estimator estimates this roughness functional from a pilot estimate of the second derivative and substitutes it into the optimal smoothing bandwidth formula. Alternatively, Leave-one-out cross-validation minimizes
where uses the other observations. By independence, the expectation of the second term is , so . Thus it targets integrated error without knowing . The choice of smoothing bandwidth remains important: even for the optimal Epanechnikov kernel, setting multiplies the leading minimum error by .
The preceding optimum concerns nonnegative second-order kernels for density estimation and twice-smooth densities on the real line. Signed kernels of order ell can cancel higher moments for smoother densities and yield different rates, but may produce negative density estimates. A support boundary or a density jump also requires separate bias of a kernel density estimator analysis. These settings do not contradict the proved second-order optimality of the Epanechnikov kernel.
Iterating the recurrence yields
Thus every finite collection of the is a linear transformation of independent standard normal random variables, and has a multivariate Gaussian distribution. The expected values are zero. Independence of the gives
For , the recurrence writes plus a sum of future innovations independent of . Hence . The required vector law is
The covariance matrix is positive definite: the lower-triangular transformation from has nonzero diagonal entries . This also identifies a stationary autoregressive process of order one, with marginal density .
With the standard normal density as the kernel for density estimation, the two characteristic functions are and . The Gaussian random variable has mean zero and variance , so
This expression is real. Substitution in the given integrated covariance expression, followed by the Gaussian integral for , gives
To bound the total Gaussian autoregressive kernel variance correction, apply the mean value theorem to . For , the whole interval between and is bounded below by . Therefore
Summing the geometric series gives the uniform bound
It follows from the supplied variance identity that
The constant depends on the fixed , but not on or . In particular this applies to the requested shrinking-bandwidth regime; the covariance bound itself does not need .
All observations have the same marginal density , so dependence changes the variance but not the bias of a kernel density estimator: . Write and . For a smooth density with , the integrated variance of a kernel density estimator in the independent case is . A second-order Taylor expansion of the convolution gives in the L2 norm. Thus the bias-variance decomposition of mean squared error gives
The first two terms are the asymptotic mean integrated squared error. The additional dependence term is smaller than , so the leading optimal bandwidth and optimal rate are the same as for independent data:
Here both and are the standard normal density. Since , direct Gaussian integrals give
Consequently the explicit leading bandwidth is
At this bandwidth the leading integrated variance is four times the leading integrated squared bias, which is also a check on the minimization constant.
For a normalized kernel for density estimation , with , the kernel density estimator is
It replaces each atom of the empirical measure by a translated, scaled copy of : averaging these small probability-density bumps gives a smooth approximation to the sampling density. Integral one is part of the probability-kernel convention; without it, the estimator generally targets .
The printed bandwidth assumption is insufficient for the claimed normal limit. The additional condition is needed at points with positive density. For a counterexample, take a normal distribution density , , the unit-width box kernel and . Then , but the probability that any observation lies in the window is at most . On the complementary event the estimator is zero, and . The limit in probability is therefore zero, whereas the stated normal limit has positive variance.
We now prove the intended pointwise central limit theorem for a kernel density estimator under , and . The first condition also follows from the last one. A mean value theorem bound, with , gives the bias of a kernel density estimator
Thus the bias multiplied by tends to zero.
The Lindeberg-Feller central limit theorem says that independent centered variables in each row of a triangular array have sum converging in distribution to if the sum of their variances tends to and, for every , the sum of their truncated second moments tends to zero. Put and . The independence hypothesis holds within each row. A change of variable gives
Continuity of at and the compact support and boundedness of justify the limit. Also , so the Lindeberg condition is eventually identically zero for every . The sum is exactly . Combining the centered limit with the negligible bias by the Slutsky theorem proves
If , the centered variance tends to zero, and the Chebyshev inequality proves the corresponding degenerate limit directly.
For , let be the supplied -quantile of this limiting normal distribution. Inverting the limiting central probability gives the confidence interval
Continuity of the limiting distribution gives asymptotic coverage . Equivalently, its half-width is under the stipulated oracle quantiles. A degenerate limit at does not by itself justify this nominal-coverage normal interval.
For a kernel for density estimation and smoothing bandwidth , the kernel density estimator is
We use the convention that a kernel of order ell has
The kernel for density estimation is integrable and can have negative values; requiring nonnegativity would prevent its second moment from vanishing. Some conventions additionally require a nonzero moment of order . The construction below covers that convention too.
The Legendre polynomial kernel construction uses the polynomial reproducing kernel at zero:
Every polynomial of degree at most has the expansion , since the displayed Legendre polynomials have those successive degrees and form an orthonormal basis of this polynomial space. Therefore
Taking proves all the required moment identities. Boundedness and compact support give every absolute moment and a finite L2 norm. If a nonzero moment of order is required, replace this kernel by
The lower moments are unchanged by orthogonality. If , then because otherwise would lie in the polynomial space of degree at most . Evaluating its full Legendre expansion at zero gives , so .
For instance, a simple kernel satisfying the moment conditions needed for three derivatives is
Its negative wings cancel its central contribution to the second moment.
Figure 1.
Signed kernel and cancellation of its second moment
. Details.
Here is the third-order pointwise kernel error bound. Write and , and use any square-integrable kernel with unit integral, first two moments zero and . A change of variables gives
By the Taylor theorem with Lagrange remainder,
The moment cancellations consequently give the uniform bias of a kernel density estimator bound
For the variance, independence and another change of variables give
The triangle inequality and Cauchy-Schwarz inequality now yield
Balancing against gives
The constant is independent of both and . The original PDF has exponent ; the converted TeX's is a transcription error.
To obtain the final parametric rate, we choose a flat-top kernel for density estimation. This kernel also satisfies all the preceding moment conditions, so a single kernel works for both constructions, with different bandwidth choices. With the Fourier transform convention , choose a real even function equal to one on and zero outside , and put
Such a cutoff is explicit: if for and zero otherwise, take . It is constant near zero, and its endpoint transitions are smooth. Repeated integration by parts shows that and all its derivatives decay faster than every power, so lies in the Schwartz space. The Fourier inversion and moment differentiation of the Fourier transform give
Thus this kernel can be used with for the preceding general bound.
For the sharper example choose the probability density function
To check this is a density and identify its Fourier transform, direct integration gives
The continuous value at zero is as displayed. This function is nonnegative and integrable, being bounded near zero and at infinity. Fourier inversion gives , and in particular . Differentiation of this compact frequency integral also shows that and are bounded. Since on the support of , the convolution theorem gives
Both sides are continuous, so the equality holds at every . There is therefore exactly zero bias of a kernel density estimator at bandwidth one, and the variance bound above gives
This is parametric-rate kernel estimation of a bandlimited density. A fixed bandwidth is appropriate because it reproduces this particular density exactly; a generic density would retain a nonzero smoothing bias.