Hello,

 

I apologize for eventual double-posting.

 

I am trying to integrate a 2-dimensional function that already calls the
function adapt. More precisely, I am calling 

 

adapt(2,lower=c(-100,-100),upper=c(100,100),functn=function(s){1-exp(-50*Unc
enteredGauss(c(-10,10,-10,10),60,s)})

 

where UncenteredGauss is given by the following code in R:

 

UncenteredGauss=function(limsamp,sigma2,s) 

{

int=adapt(2,lower=c(limsamp[1],limsamp[3]),upper=c(limsamp[2],limsamp[4]),fu
nctn=function(u){h(sigma2,s,u)})

value=int$value

return(value)

}

h=function(sigma2,s,u){1/(2*pi*sigma2)*exp(-((u[1]-s[1])^2+(u[2]-s[2])^2)/(2
*sigma2))}

 

This does not return an error message but a value that is not the good one.

UncenteredGauss gives the good result, but I believe the problem comes from
calling in adapt a function that already calls adapt

Any idea on how to integrate a function that already contains an integral???

 

Thanks!

 

Helene Morlon

Green Lab

Center for Ecology and Evolutionary Biology

University of Oregon, Eugene

[EMAIL PROTECTED]

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to