# State of the art: Non-parametric density estimation with a boundary and data clumped near zero [duplicate]

I have some data which I wish to estimate the marginal distribution of. I have no real idea what parametric distribution would be suitable, so was planning on fitting a non-parametric (probably kernel) density estimate to the data.

However, there are two complications

1) The data has a hard threshold at $0$

2) The data is mostly clumped around zero -- it is probably fair to say that it is a mix of two distributions, one being almost a delta at $0$, and the other being a strictly positive distribution with a long tail.

I know of some methods to deal with 1), but the simple methods I have used (reflection kernels) lead to unsatisfactory results near zero. I don't really know what to do about 2).

What is the state of the art for this kind of problem? Maybe an R-package that implements something I could try out?

Happy to give an example of the data, but I'm not sure the best way to do this. Let me know and I can edit the question.

EDIT: I tried the logspline idea - with and without removing the zeros (I actually removed all values very close to zero, $<0.05$). For interest sake, the result without removing the zeros is:

And with the zeros removed:

It looks like that with the zeros removed, an exponential distribution might fit fairly well.

• You might also consider logspline density estimation, perhaps with constraints on the splines to reflect your knowledge. Nov 22, 2013 at 9:09
• Density estimation involving any kind of smoothing presupposes a smooth density to estimate. Given any strong evidence for a spike and no method is guaranteed to work well. Spikes at the bound(s) are worst of all. In addition to what you know about, removing the spike, smoothing the rest and putting back the spike might be one strategy. Nov 22, 2013 at 9:53
• @Glen_b: I did actually try the R 'logspline' library, but it failed to converge. Might be worth taking a second look though. Nov 22, 2013 at 19:14
• @NickCox: Well you certainly make a good point... modelling it as a 'switching process' was in the back of my mind, but I was a little weary of an approach that seemed more complicated than it needed to be. Simply removing and then adding back the spike is a good idea, I'll give it a go! Nov 22, 2013 at 19:16
• Another possibility would perhaps be to consider a finite mixture. Nov 22, 2013 at 21:12

The approach can also be adapted to the case you where your random variable is distributed in $[0,+\infty)$