[R] nonparametric densities for bounded distributions
dwinsemius at comcast.net
Sat Mar 10 00:37:57 CET 2012
On Mar 9, 2012, at 4:36 PM, Max Kuhn wrote:
> Can anyone recommend a good nonparametric density approach for data
> (say between 0 and 1)?
I thought the "canonical" answer, at least the one that generally is
put forward whe people have difficulty with the stats::spline results
was to turn to function 'logspline' in package logspline.
> For example, using the basic Gaussian density approach doesn't
> generate a
> very realistic shape (nor should it):
>> dat <- rbeta(100, 1, 2)
dat <- rbeta(100, 1, 2)
lsdat <- logspline(dat, lbound=0,ubound=1)
# yield sharp edges to density.
> (note the area outside of 0/1)
> The data I have may be bimodal or have other odd properties (e.g.
> mass at zero).
Ah, the Dirac function. (Just my physics background showing.)
> I've tried transforming via the logit, estimating the
> density then plotting the curve in the original units, but this
> seems to do
> poorly in the tails (and I have data are absolute zero and one).
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help