[R] Density estimation when an end may not go to zero?

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Tue 08 Mar 2005 - 04:49:57 EST

      All the density estimators I've found in R seem to force the ends to go to zero. What can we do if we don't believe that, e.g., with something that might be a uniform distribution or a truncated normal with only observations above mu+sigma observed?

      The closest I could come to this was to artificially extend the numbers beyond the range, thereby forcing the density estimator to continue outside the range of the numbers, then plot only the part that I wanted. The following example supposes simulates observations from a truncated normal with mean 0, standard deviation 1, and only observations above 1.5 are observed and we faked numbers between 1 and 1.5:

set.seed(1)
tst <- rnorm(1000)
tst1 <- tst[tst>1]
knl <- density(tst1)
sel <- knl$x>1.5
plot(knl$x[sel], knl$y[sel], type="l")

      Are there any convenient methods for handling this kind of thing currently available in R?

      Thanks,
      Spencer Graves

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Mar 08 05:00:26 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:41 EST