我正在做一些药代动力学分析,并且对非房室方法没问题。但我也尝试学习一些非线性曲线拟合技术。
如果我们有以下数据:
df <- data.frame(x = c(0,2,4,8,12,24,48,72), y = c(0.000,0.05,0.0671,0.068,0.05,0.0250,0.0103,0.0043))
plot(df$x, df$y)
我想按照本书第579页所述,使用下面突出显示的方程来拟合一条非单调双指数曲线:
我对标准双指数形式很满意,并使用
Sbiexp
查找起始值,但不知道如何找到该方程的起始值。有人可以给我一些指点吗?
> nls_mod_bi <- nls(y ~ k * (exp(-b1*x) - exp(-b2*x)), start = c(k = 1, b1 = 1, b2 = 1), data = df)
Error in nlsModel(formula, mf, start, wts, scaleOffset = scOff, nDcentral = nDcntr) :
singular gradient matrix at initial parameter estimates