これらのデータに対してnls関数を使用できない理由がわかりません。さまざまな開始値を試してみましたが、常に同じエラーが発生します。
これが私がやってきたことです:
expFct2 = function (x, a, b,c)
{
a*(1-exp(-x/b)) + c
}
vec_x <- c(77.87,87.76,68.6,66.29)
vec_y <- c(1,1,0.8,0.6)
dt <- data.frame(vec_x=vec_x,vec_y=vec_y)
ggplot(data = dt,aes(x = vec_x, y = vec_y)) + geom_point() +
geom_smooth(data=dt, method="nls", formula=y~expFct2(x, a, b, c),
se=F, start=list(a=1, b=75, c=-5)
私はいつもこのエラーがあります:
Error in method(formula, data = data, weights = weight, ...) :
singular gradient