From: Lynette <fuyaonv_at_hotmail.com>

Date: Mon 22 Jan 2007 - 16:53:26 GMT

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. Received on Tue Jan 23 04:07:55 2007

Date: Mon 22 Jan 2007 - 16:53:26 GMT

Well,

I have no idea either. I can get correct answers for continous functions but incorrect for step functions.

Sign, I have been trying to realize the integration in C for long time.

Thank you for your answering.

Best,

Lynette

- Original Message ----- From: "Thomas Lumley" <tlumley@u.washington.edu> To: "Lynette" <fuyaonv@hotmail.com> Cc: <r-help@stat.math.ethz.ch>; "AJ Rossini" <blindglobe@gmail.com>; <ess-help@stat.math.ethz.ch> Sent: Monday, January 22, 2007 10:48 AM Subject: Re: [R] How to get correct integration in C for step function?

> 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. Received on Tue Jan 23 04:07:55 2007

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Mon 22 Jan 2007 - 18:30:31 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*