Re: [R] double integral

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Sat 06 May 2006 - 00:27:05 EST

On Fri, 5 May 2006, Dominique Katshunga wrote:

> Dear r-users,
> Is there any command in R allowing to evaluate a double integral? for
> instance let say I want to evaluate the following integral:
> integrate[lo=(0,1),up=(2,3)] f(x,y)=x^2+y^2
> where lo is the vector of lower bounds and up that of upper bounds.
> I thaught the function "adapt" would work but it did not.

Works for me:

> library(adapt)
> help(adapt)
> adapt(2,c(0,2),c(1,3),functn=function(xy) xy[1]^2+xy[2]^2)

        value       relerr       minpts       lenwrk        ifail
     6.666667 7.315578e-08          165           73            0


 	-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 Received on Sat May 06 00:34:39 2006

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 Sat 06 May 2006 - 02:09:59 EST.

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