Open mpmontanal opened 1 year ago
Hi and thank you for your interest in devRate.
"Missing value or an infinity produced when evaluating the model" and "singular gradient" are typical problems encountered by the nls() function (Gauss-Newton algorithm) which is used by default by the devRateModel() function.
This problem can (sometime) be circumvented by using another algorithm, such as the Levenberg-Marquardt algorithm (from the minpack.lm package).
In the devRateModel() function, the algo argument can be used to choose the "GN" or "LM" algorithm (make sure to install the minpack.lm package first):
algo: The abbreviated name of the algorithm used for model fitting ( "GN" for Gauss-Newton algorithm, "LM" for Levenberg-Marquardt algorithm; "GN" is the default value).
Example:
bri1_egg <- devRateModel( eq = briere1_99, algo = "LM", temp = temp, devRate = devRate, startValues = list(aa = 1.12, Tmin = 0.021, Tmax = 32.29) )
Let me know if I can help you further.
Best regards.
Thanks for your quick response, I thought I had solved the problem completely with the solution you gave me. However, when I use it with lactin2_95 or davidson_44 with a certain dataset I get:
Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates
I have tried without modifying the algo but it still gives an error.
Do you know what it could be?
Maybe you do not have enough data to fit Lactin2_95 or davidson_44 models ? Send me your dataset if you want, and I'll have a look.
Hi, I am trying to adjust my empirical data to the nonlinear models, I have tried to use the initial values for each model of close species and averages as indicated in the package guides. I have also used my data as vectors and as data frames. However, in all cases I have obtained the errors below:
I would appreciate if you could guide me in possible solutions