【发布时间】:2021-09-29 19:52:30
【问题描述】:
R 中的 drc 包包含自启动函数,用于将 3 参数 Weibull 模型拟合到数据。该软件包提供了 3 参数 weibull (https://cran.r-project.org/web/packages/drc/drc.pdf) 的 2 个参数化:
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)))))
包的文档表明d 代表上渐近线,b 是速率参数,并且曲线在剂量e 处具有拐点。但是,绘制这些函数并使用 R 来求解何时二阶导数 = 0 给出的值与拐点的 e 不同。例如:
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?
文档不正确吗?或者这是否与 weibull 的特定记录参数化有关(将其限制为正数)?
【问题讨论】:
标签: r nonlinear-functions weibull drc