I am an R newbie trying to fit stable conservative tracer-related values to a particular model accepted by experts. The goal is to get an estimated coefficient value of a. Here is the error I keep getting:
"Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model"
The data file used in the code is available at: https://github.com/EmmaQin67/CTD-data/blob/main/at4219002_up.txt
Here's my code:
oct30NDRO<-read.table("at4219002_up.txt",header=TRUE,sep="")
zstar<-data.frame(x=oct30NDRO$DepSM,y=oct30NDRO$T090C)
fit = nls(y~(0.3401*(exp(x/a)-1)/(exp(0.127/a)-1)+6.5583), data=zstar, start=list(a=0.5))
print(fit)
I tried to change the start value a couple of times, but no luck. When I changed the start value to a=1, I get another error message:
"number of iterations exceeded maximum of 50"
I'm expecting to get a summary of the nonlinear fit and get the estimated value of parameter a.
Thank you a lot!