Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in 3-parameter weibull? #22

Open
ThomasKraft opened this issue Jul 22, 2021 · 0 comments
Open

problem in 3-parameter weibull? #22

ThomasKraft opened this issue Jul 22, 2021 · 0 comments

Comments

@ThomasKraft
Copy link

I've been using W1.3() and W2.3() to fit a 3-parameter Weibull model to data. drc 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)))))

The documentation states that d represents the upper asymptote, b is the slope at inflection (maximum of first derivative?), 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 that e represents the inflection point? Or is there some other explanation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant