Re: [R] Integration with variable bounds

2011-03-29 Thread Dmlong21
That works perfectly! Thanks so much. DUSTIN -- View this message in context: http://r.789695.n4.nabble.com/Integration-with-variable-bounds-tp3413606p3416851.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
han Date: Tuesday, March 29, 2011 9:13 pm Subject: Re: [R] Integration with variable bounds To: Dmlong21 Cc: r-help@r-project.org > You get 0 because you did not specify lower and upper bounds that > define the hyper-rectangle; therefore, the default is used which is (0,1)^4. > > Specify

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Dmlong21 Date: Tuesday, March 29, 2011 3:11 pm Subject: Re: [R] Integration with variable bounds To: r-help@r

Re: [R] Integration with variable bounds

2011-03-29 Thread Dmlong21
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.0

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
gy School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Dmlong21 Date: Tuesday, March 29, 2011 3:05 am Subject: [R] Integration with variable bounds To: r-help@r-project.org > If this is posted elsewhere I cannot find

[R] Integration with variable bounds

2011-03-29 Thread Dmlong21
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] u