[R] Follow-up on nls convergence failure with SSfol

Douglas Bates bates at stat.wisc.edu
Mon Jan 24 20:35:26 CET 2005


A couple of weeks ago there was a question regarding apparent 
convergence in nls when using the SSfol selfStart model for fitting a 
first-order pharmacokinetic model.  I can't manage to find the original 
message either in my archive or in the list archives but the data were

   time  conc dose
   0.50  5.40    1
   0.75 11.10    1
   1.00  8.40    1
   1.25 13.80    1
   1.50 15.50    1
   1.75 18.00    1
   2.00 17.00    1
   2.50 13.90    1
   3.00 11.20    1
   3.50  9.90    1
   4.00  4.70    1
   5.00  5.00    1
   6.00  1.90    1
   7.00  1.90    1
   9.00  1.10    1
  12.00  0.95    1
  14.00  0.46    1

and the attempted fit looked like

 > nls(conc ~ SSfol(dose, time, lKe, lKa, lCl), testdat, trace = 1)
nls(conc ~ SSfol(dose, time, lKe, lKa, lCl), testdat, trace = 1)
99.15824 :  -1.2061792  0.1296156 -4.3020997
86.07567 :  -0.7053265 -0.3873204 -4.1278009
85.19743 :  -0.5548499 -0.5333776 -4.1173627
Error in nls(conc ~ SSfol(dose, time, lKe, lKa, lCl), testdat, trace = 1) :
	step factor 0.000488281 reduced below `minFactor' of 0.000976562

If one allows much smaller step factors you can get more iterations but 
nls still doesn't converge.

It took me a long time to find out why.  The lack of convergence is 
related to the form of the SSfol model.  When the first two parameters 
(lKe and lKa) are equal the model degenerates to a different analytic 
form.  If you were to express the corresponding system of ordinary 
differential equations in the matrix form (as described in Appendix 5 of 
Bates and Watts (1988)), it would be a Schur triangular block and the 
special techniques for nondiagonalizable matrices, described in section 
A5.2 of that appendix, must be used.

The clue here is that the first two parameter values are getting very 
close to each other and this shows up as a singularity.  The fitted 
model is determined by two parameters, not three.




More information about the R-help mailing list