Re: [R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

From: Mario Valle <mvalle_at_cscs.ch>
Date: Tue, 12 Apr 2011 18:53:08 +0200

Use a more realistic starting point instead of the default one:

fit <- nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x), start=list(p1=410,p2=18,p4=-.03))

This works for me:
 > fit
Nonlinear regression model

   model: yeps ~ p1/(1 + exp(p2 - x)) * exp(p4 * x)     data: parent.frame()

        p1 p2 p4
199.48276 16.28664 -0.01987
  residual sum-of-squares: 560.6

Number of iterations to convergence: 5
Achieved convergence tolerance: 5.637e-07

Ciao!

                         mario

On 12-Apr-11 18:01, Felix Nensa wrote:
> fit = nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x))
>

-- 
Ing. Mario Valle
Data Analysis and Visualization Group            | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 12 Apr 2011 - 16:55:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Apr 2011 - 17:50:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive