From: Davood Tofighi <dtofighi_at_asu.edu>

Date: Fri, 07 Mar 2008 13:00:31 -0700

Date: Fri, 07 Mar 2008 13:00:31 -0700

Dear All,

I have a function f(x,y,z)=exp(x^3+y^4+x^2*y+x*z^2+y/z) over D, where is D={ (x,y,z)| 0 <z<Inf, 0<y<c1*z, 0<x<c2*/y}. x,y,z are all vectors and c1 and c2 are constants. I tried the "adapt" package and I get some error. This is the error message:

"Error in function (z, y, x) : argument "x" is missing, with no default"

I included my R code. Can anyone please let me know how I can calculate the numerical integral of such a function where some of the boundaries are functions of the other variables?

require(adapt)

fn<-function(z,y,x) {exp(x^3+y^4+x^2*y+x*z^2+y/z)}
x<-runif(200);y<-runif(200);z<-runif(200);
c1<-.5;c2<-5;M<-100; #M to represent infinity
i1<-adapt(3,lo=c(.0001,0,0),up=c(M,c1*z,c2/y),functn=fn)$value
print(i1);

Thanks,

-- Davood Tofighi [[alternative HTML version deleted]] ______________________________________________ R-help_at_r-project.org 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 Fri 07 Mar 2008 - 20:03:21 GMT

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

Archive generated by hypermail 2.2.0, at Sat 08 Mar 2008 - 00:30:20 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.
*