I am having trouble fitting an exponential curve to my data.
Here's my code:
x<-c(0.134,0.215,0.345,0.482,0.538,0.555)
y<-c(0,0,0.004,0.291,1.135,1.684)
plot(x,y)
estimates<- list(b1 = 0.1, b2 = 5e-7)
nlfit <- nls(y ~ b1 * (exp(x/b2)-1), start=estimates)
lines(x, predict(nlfit), col = 2)
But I get the following error:
Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model
I have tried several approaches described on Stack Overflow, such as removing the zeros or fitting it to a simpler model (log), but all of them just gave me a different error. My guess would be that I need better starting values, but I can't seem to find them without getting any errors.