On Sun, 21 Jan 2007, Lynette wrote:

> Dear all,
>
> I am using Rdqags in C to realize the integration. It seems for the
> continous C function I can get correct results. However, for step functions,
> the results are not correct. For example, the following one, when integrated
> from 0 to 1 gives 1 instead of the correct 1.5
>

Using integrate() in R for an R-defined step function gives the right 
answer (eg on the example in ?ecdf).

This suggests a problem in your C code, since integrate() just calls 
dqags.

        -thomas

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to