aravind-j / germinationmetrics

Seed Germination Indices and Curve Fitting
https://aravind-j.github.io/germinationmetrics/
3 stars 1 forks source link

use of warnOnly argument in gsl_nls() #8

Open JorisChau opened 6 months ago

JorisChau commented 6 months ago

There are several calls to gsl_nls() that make use of the argument warnOnly, which is a valid argument of nls.control(), but not of gsl_nls_control(), e.g. in FourPHFfit.R:

gsl_nls(
          csgp ~ FourPHF_fixy0(x = intervals, a, bta, c),
          data = data,
          algorithm = algorithm,
          start = list(a = starta, bta = startbta, c = startc),
          control = list(maxiter = maxiter, warnOnly = warnOnly,
                         scale = "levenberg"))

Reverse dependency checks of a new version of gslnls initially failed because of this use of warnOnly. I have currently updated gsl_nls_control() to allow for spurious arguments, such as warnOnly, but this is not used anywhere downstream by gsl_nls().

Note: gsl_nls() now always returns a warning in case the gradient at the parameter estimates is singular (where the error thrown by minpack.lm::nlsLM() or nls() can be turned into a warning with warnOnly). In all other cases where gsl_nls() fails to converge, (e.g. because the max. number of iterations was exceeded), this will show up in the convInfo element of the model fit.

KR, Joris