Re: [R] nls fitting problems (singularity)

From: Peter Dalgaard <>
Date: Thu 01 Jul 2004 - 00:04:00 EST

Douglas Bates <> writes:

> Often when nls doesn't converge there is a good reason for it.
> I'm on a very slow internet connection these days and will not be able
> to look at the data myself but I ask you to bear in mind that, when
> dealing with nonlinear models, there are model/data set combinations
> for which there are no parameter estimates.

In this particular case, the model describes a curve consisting of two line segments that meet at the point (b,d)

> > : nls(y~d+(x-b)*c1*(x-b<0)+(x-b)*c2*(x-b>=0), data=df2,

Now if b is between the two smallest x, you can diddle b, c1, and d in such a way that the value at x1 is constant. I.e. the model becomes unidentifiable. Putting trace=T suggests that this is what happens in this example.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (             FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu Jul 01 00:08:22 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 04:45:31 EST