Skip to content
Prev 280261 / 398506 Next

uniroot function question

kchkchkch wrote
Shouldn't the line with uniroot be (why try as function?)

sol = uniroot(fcn, lower = p1, upper = 1)

Before the line with  for(i in 1:n) insert the following

fcn = function(p2) p1*f(p1) + (.20/5.66)*(exp(5.66*(p2 - p0)) - exp(5.66*(p1
- p0))) + (1 - p2)*f(p2) - as.numeric(f.integral$value) 
curve(fcn, from=0, to=1)

And it should be obvious what the problem is.

Berend

--
View this message in context: http://r.789695.n4.nabble.com/uniroot-function-question-tp4195737p4196220.html
Sent from the R help mailing list archive at Nabble.com.