I'm working with the "geyser" data set from the MASS package and comparing kernel density estimates of the np package.
My problem is to understand the density estimate using least squares cross-validation and the Epanechnikov kernel:
blep<-npudensbw(~geyser$waiting,bwmethod="cv.ls",ckertype="epanechnikov")
plot(npudens(bws=blep))
For the Gaussian kernel it seems to be fine:
blga<-npudensbw(~geyser$waiting,bwmethod="cv.ls",ckertype="gaussian")
plot(npudens(bws=blga))
Or if I use the Epanechnikov kernel and maximum likelihood cv:
bmax<-npudensbw(~geyser$waiting,bwmethod="cv.ml",ckertype="epanechnikov")
plot(npudens(~geyser$waiting,bws=bmax))
Is it my fault or is it a problem in the package?
Edit: If I use Mathematica for the Epanechnikov kernel and least squares cv it is working:
d = SmoothKernelDistribution[data, bw = "LeastSquaresCrossValidation", ker = "Epanechnikov"]
Plot[{PDF[d, x], {x, 20,110}]