Hello there, I am using NLS for fitting a complex model to some data to estimate a couple of the missing parameters. The model is - y ~ (C+((log(1-r))*exp(-A*d)*(-1+r+exp(d*(A-B)))/(r*(-A*d+d*B+log(1-r))))) where A, B and C are unknown.
In order to test the model, I generate data by setting values for all parameters and add some noise (C). A <- 20 B <- 500 r <- 0.6881 d <- (1:1000)/1000 y ~ (rnorm(d)*0.005)+(((log(1-r))*exp(-A*d)*(-1+r+exp(d*(A-B)))/(r*(-A*d+d*B+log(1-r))))) I use Deoptim package to pick the optimum starting values. The model works fine in most cases, but every now and again, I get the following error - Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model Any suggestions on how I can resolve this? Can you suggest a better way for picking the starting parameters? Thanks, Diviya [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.