Roberto Molinari
2011-Jul-16 14:26 UTC
[R] How does locpoly (KernSmooth package) estimate densities?
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. Could anyone give me some insight on how this function works in R? Thank you! Roberto. [[alternative HTML version deleted]]
Xu Wang
2014-Mar-27 05:47 UTC
Re: How does locpoly (KernSmooth package) estimate densities?
On Sat, Jul 16, 2011 at 10:26 AM, Roberto Molinari <roberto.molinari@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