[R] cuhre usage ?? multidimensional integration

sevenfrost linshuang11 at gmail.com
Wed Oct 5 07:26:22 CEST 2011


my=function(x){
len=1
for(i in 1:len){
y[i]=x[i]
}
g=1
w=NULL
t=NULL
for(i in 1:len)w[i]=x[i+len]
for(i in 1:len)t[i]=x[i+2*len]
for(i in 1:len)g=g*dnorm(y[i])*dnorm(w[i])*dnorm(z[i])
return(g)
}
cuhre(6,1,my,rep(-100,6),rep(100,6))

Error in crff(match.call(), integrand, "cuhre", libargs, ...) : 
  Additional argument  not expected in the integrand function

function change to my=function(x,g,i,j)
result is not right. it should be 1, but it turns out to be 0.039...

How can I make this work?

Thank you!

--
View this message in context: http://r.789695.n4.nabble.com/cuhre-usage-multidimensional-integration-tp3873478p3873478.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list