Skip to content
Prev 22898 / 398502 Next

Surprising result from integrate

On Fri, 23 Aug 2002, Daniel Hoppe wrote:

            
The problem is that  f2 is nearly zero for most of its range, eg for
t=100, it is 6.4e-11. The integrate() function only evaluates the function
at finitely many places and at some point it gets zero at all these points
and doesn't notice the tiny region where f2 is non-zero.

If you really want to integrate out to infinity then say so:
 > bergernasr.clv.continuous(Inf)
 112.1139 with absolute error < 1.2e-12
 150.2340 with absolute error < 0.0010
 [1] 282.3478
and it will work.

You can see a simpler version of the same thing with dnorm:
0.4772499 with absolute error < 5.3e-15
0.5 with absolute error < 3.7e-05
0.5 with absolute error < 1.6e-07
0.5 with absolute error < 4.4e-06
0 with absolute error < 0


	-thomas



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._