Multivariate kernel density estimation

It can be viewed as a generalisation of histogram density estimation with improved statistical properties.

Apart from histograms, other types of density estimators include parametric, spline, wavelet and Fourier series.

Kernel density estimators were first introduced in the scientific literature for univariate data in the 1950s and 1960s[1][2] and subsequently have been widely adopted.

Based on research carried out in the 1990s and 2000s, multivariate kernel density estimation has reached a level of maturity comparable to its univariate counterparts.

This requires the choice of an anchor point (the lower left corner of the histogram grid).

[6] One possible solution to this anchor point placement problem is to remove the histogram binning grid completely.

In the left figure below, a kernel (represented by the grey lines) is centred at each of the 50 data points above.

The most striking difference between kernel density estimates and histograms is that the former are easier to interpret since they do not contain artifices induced by a binning grid.

Aggregating the individually smoothed contributions gives an overall picture of the structure of the data and its density function.

In the details to follow, we show that this approach leads to a reasonable estimate of the underlying density function.

The previous figure is a graphical representation of kernel density estimate, which we now define in an exact manner.

Let x1, x2, ..., xn be a sample of d-variate random vectors drawn from a common distribution described by the density function ƒ.

On the other hand, the choice of the bandwidth matrix H is the single most important factor affecting its accuracy since it controls the amount and orientation of smoothing induced.

[7][8] The most commonly used optimality criterion for selecting a bandwidth matrix is the MISE or mean integrated squared error This in general does not possess a closed-form expression, so it is usual to use its asymptotic approximation (AMISE) as a proxy where The quality of the AMISE approximation to the MISE[3]: 97  is given by where o indicates the usual small o notation.

Heuristically this statement implies that the AMISE is a 'good' approximation of the MISE as the sample size n → ∞.

It can be shown that any reasonable bandwidth selector H has H = O(n−2/(d+4)) where the big O notation is applied elementwise.

[9][10] These references also contain algorithms on optimal estimation of the pilot bandwidth matrix G and establish that

[10][11] These references also contain algorithms on optimal estimation of the pilot bandwidth matrix G and establish that

Using the standard mean squared value decomposition we have that the MSE tends to 0, implying that the kernel density estimator is (mean square) consistent and hence converges in probability to the true density f. The rate of convergence of the MSE to 0 is the necessarily the same as the MISE rate noted previously O(n−4/(d+4)), hence the convergence rate of the density estimator to f is Op(n−2/(d+4)) where Op denotes order in probability.

This dataset (included in the base distribution of R) contains 272 records with two measurements each: the duration time of an eruption (minutes) and the waiting time until the next eruption (minutes) of the Old Faithful Geyser in Yellowstone National Park, USA.

The code fragment computes the kernel density estimate with the plug-in bandwidth matrix

The routine is an automatic bandwidth selection method specifically designed for a second order Gaussian kernel.

[14] The figure shows the joint density estimate that results from using the automatically selected bandwidth.

There are alternative optimality criteria, which attempt to cover cases where MISE is not an appropriate measure.

[4]: 34–37, 78  The equivalent L1 measure, Mean Integrated Absolute Error, is Its mathematical analysis is considerably more difficult than the MISE ones.

[16] Likelihood error criteria include those based on the Mean Kullback–Leibler divergence and the Mean Hellinger distance The KL can be estimated using a cross-validation method, although KL cross-validation selectors can be sub-optimal even if it remains consistent for bounded density functions.

[19] Recent research has shown that the kernel and its bandwidth can both be optimally and objectively chosen from the input data itself without making any assumptions about the form of the distribution.

[20] The resulting kernel density estimate converges rapidly to the true probability distribution as samples are added: at a rate close to the

However, it has been found that the ECF can be approximated accurately using a non-uniform fast Fourier transform (nuFFT) method,[21][22] which increases the calculation speed by several orders of magnitude (depending on the dimensionality of the problem).

The combination of this objective KDE method and the nuFFT-based ECF approximation has been referred to as fastKDE in the literature.

Left. Histogram with anchor point at (−1.5, -1.5). Right. Histogram with anchor point at (−1.625, −1.625). Both histograms have a bin width of 0.5, so differences in appearances of the two histograms are due to the placement of the anchor point.
Comparison of 2D histograms. Left. Histogram with anchor point at (−1.5, -1.5). Right. Histogram with anchor point at (−1.625, −1.625). Both histograms have a binwidth of 0.5, so differences in appearances of the two histograms are due to the placement of the anchor point.
Left. Individual kernels. Right. Kernel density estimate.
Construction of 2D kernel density estimate. Left. Individual kernels. Right. Kernel density estimate.
Comparison of the three main bandwidth matrix parametrisation classes. Left. S positive scalar times the identity matrix. Centre. D diagonal matrix with positive entries on the main diagonal. Right. F symmetric positive definite matrix.
Comparison of the three main bandwidth matrix parametrisation classes. Left. S positive scalar times the identity matrix. Centre. D diagonal matrix with positive entries on the main diagonal. Right. F symmetric positive definite matrix.
Old Faithful Geyser data kernel density estimate with plug-in bandwidth matrix.
Old Faithful Geyser data kernel density estimate with plug-in bandwidth matrix.
Kernel density estimate with diagonal bandwidth for synthetic normal mixture data.
Kernel density estimate with diagonal bandwidth for synthetic normal mixture data.
An x-shaped region of empirical characteristic function in Fourier space.
Demonstration of the filter function . The square of the empirical distribution function from N =10,000 samples of the ‘transition distribution’ discussed in Section 3.2 (and shown in Fig. 4), for . There are two color schemes present in this figure. The predominantly dark, multicolored colored ‘X-shaped’ region in the center corresponds to values of for the lowest contiguous hypervolume (the area containing the origin); the colorbar at right applies to colors in this region. The lightly colored, monotone areas away from the first contiguous hypervolume correspond to additional contiguous hypervolumes (areas) with . The colors of these areas are arbitrary and only serve to visually differentiate nearby contiguous areas from one another.
A demonstration of fastKDE relative to a sample PDF. (a) True PDF, (b) a good representation with fastKDE, and (c) a slightly blurry representation.
A non-trivial mixture of normal distributions: (a) the underlying PDF, (b) a fastKDE estimate on 1,000,000 samples, and (c) a fastKDE estimate on 10,000 samples.