integrate function fails! (PR#1718)
Fri, 28 Jun 2002 13:53:06 +0200 (MET DST)

Full_Name: José Enrique Chacón
Version: 1.5.0 and 1.3.1
OS: Windows Millenium
Submission from: (NULL) (

Dear reader:
I was trying to evaluate the L2 error produced when estimating the density
function N(0,1) from a sample of size 100 using a kernel density estimate. It
produced a strange value. You can reproduce the process by typing


This value err of the L2 error is generally far from accurate. fker is the
kernel density estimate with bandwidth h and Gaussian kernel. Obviously, h=5 is
a very large choice far from the optimum which is around 0.4, but it makes it
more clear to see the failure. You just have to evaluate integrand(0); then, you
know that the integral between -0.5 and 0.5 cannot be larger than integrand(0),
which was usually around 0.1. But the value that integrate gives is around 1.6!
Anyway, there is a library called rmutil (I don't remember where I got it, but I
found it searching in the forums) which contains a function called int that
works well.

I hope this problem can be solved.

Best regards,
  José Enrique Chacón

r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: