[R] Density estimate with bounds

Justine Rochon rochon at gmx.de
Sat Nov 7 11:40:22 CET 2009


Hi Greg,
Thank you very much for your help. The logspline package seems to solve the problem.
Best regards, 
Justine

-------- Original-Nachricht --------
> Datum: Thu, 5 Nov 2009 11:11:31 -0700
> Von: Greg Snow <Greg.Snow at imail.org>
> An: Justine Rochon <rochon at gmx.de>, "r-help at r-project.org" <r-help at r-project.org>
> Betreff: RE: [R] Density estimate with bounds

> You may be interested in the logspline package.  It uses a different
> method from kernel density estimation, but it estimates densities from data and
> allows the specification of lower and/or upper bounds.
> 
> Hope this helps,
> 
> -- 
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow at imail.org
> 801.408.8111
> 
> 
> > -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> > project.org] On Behalf Of Justine Rochon
> > Sent: Thursday, November 05, 2009 2:38 AM
> > To: r-help at r-project.org
> > Subject: [R] Density estimate with bounds
> > 
> > Dear R users,
> > 
> > I would like to show the estimated density of a (0, 1) uniformly
> > distributed random variable. The density curve, however, goes beyond 0
> > and 1 because of the kernel smoothing.
> > 
> > Example:
> > 
> > x = runif(10000)
> > plot(density(x))
> > 
> > Is there a way to estimate the density curve strictly within (0, 1) and
> > still use some sort of smoothing?
> > 
> > Any help would be greatly appreciated.
> > 
> > Best regards,
> > 
> > Justine Rochon
> > 
> > --
> > GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> > 
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser




More information about the R-help mailing list