[R] Integration with variable bounds

Dmlong21 dmlong at bios.unc.edu
Tue Mar 29 19:46:34 CEST 2011


Thanks for the tip but all I get is 0 for the integral.  Any other
suggestions?

int <- function(y){
u2 = y[1]
z2 = y[2]
u1 =y[3]
z1 = y[4]

reg.nonzero <- (u2 > z1 & u2 < z2) & (z2 > z1 & z2 < 12) & (u1 > 4 & u1 <
z1) & (z1 > 4 & z1 < 12)


ff <- ifelse (reg.nonzero, u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2)), 0)


return(ff)


}


cuhre(4,1,int)

--
View this message in context: http://r.789695.n4.nabble.com/Integration-with-variable-bounds-tp3413606p3415639.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list