hello R users
 
strange behavior of the integrate function!
i assume this occurs because of the way in which the quadriture is set up! (any comments.)
 
f=function(x){exp(-exp(-x)-5*x)/gamma(5)}
 
xx=seq(from=-20, to=20, length.out=1000)
plot(xx,f(xx),type="l")

integrate(f, lower=-Inf, upper= 1)
integrate(f, lower=-Inf, upper= 10)
integrate(f, lower=-10, upper= 11)
integrate(f, lower=-Inf, upper= 11)
integrate(f, lower=-Inf, upper= Inf)
 
 
the results:
 
> integrate(f, lower=-Inf, upper= 1)
0.9999586 with absolute error < 2.1e-06
 
> integrate(f, lower=-Inf, upper= 10)
1 with absolute error < 1.6e-06
 
> integrate(f, lower=-10, upper= 11)
1 with absolute error < 7.1e-06
 
> integrate(f, lower=-Inf, upper= 11)
1.375693e-06 with absolute error < 2.3e-06
 
> integrate(f, lower=-Inf, upper= Inf)
1 with absolute error < 3.1e-05
 
 
i dont get the same behaviour for J.K. Lindsey's int function.
 

 
 
 
 
Allan Clark
========
Lecturer in Statistical Sciences Department
University of Cape Town
7701 Rondebosch
South Africa
TEL (Office): +27-21-650-3228
FAX: +27-21-650-4773
http://web.uct.ac.za/depts/stats/aclark.htm 
 

	[[alternative HTML version deleted]]

