Generalized Kernel Density Estimation