Re: [R] Need help to understand integrate function

2010-08-12 Thread Ravi Varadhan
: Thursday, August 12, 2010 9:23 pm Subject: Re: [R] Need help to understand integrate function To: Ravi Varadhan Cc: r-help@r-project.org > Hi Ravi - Thank you. I'm wondering how the magic happens here with > options(digits=10)? And the most important point, I do not quite >

Re: [R] Need help to understand integrate function

2010-08-12 Thread R_help Help
(410) 502-2619 > email: rvarad...@jhmi.edu > > > - Original Message ----- > From: R_help Help > Date: Wednesday, August 11, 2010 9:44 pm > Subject: [R] Need help to understand integrate function > To: r-help@r-project.org > > >> Hi, >> >>  I'm running i

Re: [R] Need help to understand integrate function

2010-08-11 Thread Ravi Varadhan
Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: R_help Help Date: Wednesday, August 11, 2010 9:44 pm Subject: [R] Need help to understand integrate funct

[R] Need help to understand integrate function

2010-08-11 Thread R_help Help
Hi, I'm running into a wall when trying to use the integrate function. I have the following setting: powerLaw2 <- function(x,l1,l2,c0,t0) { idx <- which(x <= 0); if (length(idx) > 0) { x[idx] <- 0; } xl <- (-l1+l2)*log(x/t0); L <- log(c0)-l1*log(x)-log(1+exp(xl)); L <- e