[R] Integration with variable bounds
Dmlong21
dmlong at bios.unc.edu
Tue Mar 29 05:00:17 CEST 2011
If this is posted elsewhere I cannot find it. I need to perform multiple
integration where some of the variables are in the bounds of the other
variables. I was trying to use R2Cuba function but cannot set the upper and
lower bounds. My code so far is :
int <- function(y){
u2 = y[1]
z2 = y[2]
u1 =y[3]
z1 = y[4]
ff <- u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2))
return(ff)
}
cuhre(4,1,int,rel.tol=1e-3,lower=c(y[4],y[4],4,4),upper=c(12,y[4],12,y[2]),abs.tol=
1e-12,flags= list(verbose=2, final=0))
I know that code is wrong but it shows that variables are in both the upper
and lower bounds.
Thanks.
Dustin Long
UNC-Chapel Hill
--
View this message in context: http://r.789695.n4.nabble.com/Integration-with-variable-bounds-tp3413606p3413606.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list