[R] How does locpoly (KernSmooth package) estimate densities?

Xu Wang xuwang762 at gmail.com
Thu Mar 27 06:47:05 CET 2014


On Sat, Jul 16, 2011 at 10:26 AM, Roberto Molinari
<roberto.molinari at hotmail.it> wrote:
>
> Dear R users,
>
> I am currently using the locpoly function from the KernSmooth package to estimate densities. However, I have some trouble understanding how this estimation technique is implemented in R. My main concern comes from the fact that this function gives negative estimates when the bandwidth is sufficiently large (mainly in the tails of distributions). I have read some articles on this technique (C. Loader 1996,Hjort and Jones 1996) but from none have I managed to understand how this is possible.

Hi Robert, I'm also getting strange results (not negative densities
though!). I'm getting NaN if the bandwidth is too small. I wonder if
both of use ran into a floating point calculation issue. Note that my
question is here
http://stackoverflow.com/questions/22433502/r-locpoly-is-incorrectly-returning-nan.

Best wishes, Xu



More information about the R-help mailing list