The kernel is assumed to be Gaussian. Bandwidth matrix is
diagonal. The two bandwidth parameters are chosen optimally
without ever using/assuming any parametric model for the data
or any "rules of thumb". Unlike many other procedures, this one
is immune to accuracy failures in the estimation of multimodal
densities with widely separated modes. This function in meant to be
the R implementation of the MATLAB kde2d()
function written
and published by Z. I. Botev at:
http://web.maths.unsw.edu.au/~zdravkobotev/
kde2D(data, n = 2^8, limits = NULL)
N by 2 matrix with the two variables as columns
size of the n by n grid over which the density is computed
limits of the bounding box over which the density is computed; format: c(lower_Xlim, upper_Xlim, lower_Ylim, upper_Ylim)
A list
with bandwidth, density and grids for the two dimensions.
Z. I. Botev, J. F. Grotowski and D. P. Kroese, "Kernel Density Estimation Via Diffusion", Annals of Statistics, 2010, Volume 38, Number 5, Pages 2916-2957