The drc
package in R contains self-starting functions to fit a 3-parameter Weibull model to data. The package gives 2 parameterizations of the 3-parameter weibull (https://cran.r-project.org/web/packages/drc/drc.pdf):
f(x) = 0 + (d − 0) exp(− exp(b(log(x) − log(e))))
f(x) = 0 + (d − 0)(1 − exp(− exp(b(log(x) − log(e)))))
Documentation for the package suggests that d
represents the upper asymptote, b
is the rate parameter, and that the curve has an inflection point at dose e
. However, plotting these functions and using R to solve for when the 2nd derivative = 0 gives a value different than e
for the inflection point. For example:
dd=1
bb = -5
ee = 30
curve(dd*exp(-exp(bb * (log(x) - log(ee))) ) , xlim=c(0,100))
abline(v=ee)
# 1st deriv
g <- function(x) {}
body(g) <- D( expression(dd*exp(-exp(bb * (log(x) - log(ee))) )), "x")
curve(g, xlim=c(0, 100))
abline(v=ee)
# 2nd deriv
g <- function(x) {}
body(g) <- D(D( expression(dd*exp(-exp(bb * (log(x) - log(ee))) )), "x"), "x")
curve(g, xlim=c(0, 100))
abline(v=ee)
uniroot(g, c(20,50)) # should be 30, but is not?
Is the documentation incorrect? Or does this have to do with the particular logged parameterization of the weibull (that constrains it to be positive)?