Skip to content
Prev 82970 / 398502 Next

suggestions for nls error: false convergence

Sometimes its just one parameter that's the culprit so just use
a grid to get the starting value.  Since its known
that in logistic growth the saturation level is a problem we conjecture
that in this one m is the culprit and grid over it.  Note that with this
approach we did not need to extend the allowable iterations at all
so the control arg has been removed simplifying the call:
+   model <- try(nls(y ~ a * (1+m*exp(-x/tau)) / (1+n*exp(-x/tau)),
+                  data=d, start = list(a = 277, m = m, n = 101, tau = 10),
+                  algorithm='port'))
+    if (!inherits(model, "try-error")) print(model)
+    }
Nonlinear regression model
  model:  y ~ a * (1 + m * exp(-x/tau))/(1 + n * exp(-x/tau))
   data:  d
           a            m            n          tau
2.757817e+02 1.594652e+03 2.312661e+05 5.617307e+00
 residual sum-of-squares:  808.7282
Nonlinear regression model
  model:  y ~ a * (1 + m * exp(-x/tau))/(1 + n * exp(-x/tau))
   data:  d
           a            m            n          tau
2.757817e+02 1.594652e+03 2.312661e+05 5.617307e+00
 residual sum-of-squares:  808.7282
Error in nls(y ~ a * (1 + m * exp(-x/tau))/(1 + n * exp(-x/tau)), data = d,  :
        Convergence failure: iteration limit reached without convergence (9)
Error in nls(y ~ a * (1 + m * exp(-x/tau))/(1 + n * exp(-x/tau)), data = d,  :
        Convergence failure: singular convergence (7)
Nonlinear regression model
  model:  y ~ a * (1 + m * exp(-x/tau))/(1 + n * exp(-x/tau))
   data:  d
           a            m            n          tau
2.757817e+02 1.594652e+03 2.312661e+05 5.617307e+00
 residual sum-of-squares:  808.7282
On 12/19/05, Christian Ritz <ritz at bioassay.dk> wrote: