Greetings, I am having a very hard time with a nonlinear regression. The last chance is that maybe somebody can spot something wrong? The data and the model are described below: number of observations = 3030 y = [0,?,~16] D1969 = [.16,?,~70,000]>mod=nls(log(D1969)~d-log(1+d1*exp(-gt+g1*y)), start=list(d=11, d1=750000, >gt=14, g1=.9), trace=TRUE, data=pidg)Error in nlsModel(formula, mf, start) : singular gradient matrix at initial parameter estimates I ran several variants, changing the start values. However the graph with these starting values is almost identical with what is obtained with the real data (although it is rather nonlinear)? I am missing something, but can?t figure out what. If anybody has a little time and patience, any advice would be really really appreciated. Thanks, Mihai Nica, ABD Jackson State University ITT Tech Instructor 170 East Griffith Street G5 Jackson, MS 39201 601 914 0361 The least of learning is done in the classrooms. - Thomas Merton
Prof Brian Ripley
2006-Jun-02 06:03 UTC
[R] nls model singular gradient matrix parametrization
Your model is over-parametrized: d1*exp(-gt) gives two parameters for one constant. As a result, the least-square surface is flat in one direction, and the gradient matrix is singular. If this is the model you intended, you can simplify it by dropping d1. It is also partially linear (d) so it should be possible to get method="plinear" to work. On Thu, 1 Jun 2006, Mihai Nica wrote:> Greetings, > I am having a very hard time with a nonlinear regression. The last chance is > that maybe somebody can spot something wrongThe data and the model are> described below: > > number of observations = 3030 > y = [0,,~16]> D1969 = [.16,,~70,000]> >> mod=nls(log(D1969)~d-log(1+d1*exp(-gt+g1*y)), start=list(d=11, d1=750000, >> gt=14, g1=.9), trace=TRUE, data=pidg) > Error in nlsModel(formula, mf, start) : singular gradient matrix at initial > parameter estimates > > I ran several variants, changing the start values. However the graph with > these starting values is almost identical with what is obtained with the real > data (although it is rather nonlinear)I am missing something, but can?t> figure out what. If anybody has a little time and patience, any advice would > be really really appreciated. > Thanks, > > > Mihai Nica, ABD > Jackson State University > ITT Tech Instructor > 170 East Griffith Street G5 > Jackson, MS 39201 > 601 914 0361 > > The least of learning is done in the classrooms. > - Thomas Merton > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595