[R] integrate

From: Rogério Rosa da Silva <rogeriorosas_at_gmail.com>
Date: Fri 23 Jun 2006 - 22:12:41 EST

Dear All,

My doubt about how to integrate a simple kernel density estimation goes on.

I have seen the recent posts on integrate density estimation, which seem similar to my question. However, I haven't found a solution.

I have made two simple kernel density estimation by:  

    kde.1 <-density(x, bw=sd(x), kernel="gaussian")$y     # x<- c(2,3,5,12)
    kde.2 <-density(y, bw=sd(y), kernel="gaussian")$y     # y<- c(4,2,4,11)

Now I would like to integrate the difference in the estimated density values, i.e.:

    diff.kde <- abs (kde.1- kde.2)

How can I integrate diff.kde over -Inf to Inf ?



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 Fri Jun 23 22:13:11 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 24 Jun 2006 - 04:12:01 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.