[Rd] integrate function (PR#9557)
tlumley at u.washington.edu
Mon Mar 12 19:23:37 CET 2007
This is what numerical integration functions are like, unfortunately.
That's why the help page says:
"Like all numerical integration routines, these evaluate the function on a
finite set of points. If the function is approximately constant (in
particular, zero) over nearly all its range it is possible that the
result and error estimate may be seriously wrong."
If you know anything about where the function has jumps you can use this
knowledge to pick better intervals. Changing the subdvisions argument has
no effect, since this is the *maximum* number, not the minimum number.
I don't think we know of numerical quadrature routines that are uniformly
better than these and GPL-compatible.
On Thu, 8 Mar 2007, Bert.DeBoeck at Ugent.be wrote:
> Full_Name: Bert De Boeck
> Version: R 2.2.0
> OS: Windows
> Submission from: (NULL) (126.96.36.199)
> I think there is a bug when using integrate for integrating a function which is
> 0 in a whole sub-interval. For example:
> #define uniform function
> #this is the correct integral
> #here there is a problem
> # I noticed this for a more complex function, but as you see even for a trivial
> # function there is a serious problem
> R-devel at r-project.org mailing list
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-devel