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

From: Felix Nensa <felix.nensa_at_gmail.com>
Date: Tue, 12 Apr 2011 18:01:33 +0200

Hi Peter,

thank you for your reply. Now I see, that P3 is indeed redundand. But with the simplified model...

fit = nls(yeps ~ p1 / (1 + exp(p2 - x)) * exp(p4 * x))

...nls still produces the same error.
Any ideas?

Felix

2011/4/12 Peter Ehlers <ehlers_at_ucalgary.ca>

> On 2011-04-11 13:29, Felix Nensa wrote:
>
>> Hi,
>>
>> I am using nls to fit a non linear function to some data but R keeps
>> giving
>> me "singular gradient matrix at initial parameter estimates" errors.
>> For testing purposes I am doing this:
>>
>> ### R code ###
>>
>> x<- 0:140
>> y<- 200 / (1 + exp(17 - x)/2) * exp(-0.02*x) # creating 'perfect' samples
>> with fitting model
>> yeps<- y + rnorm(length(y), sd = 2) # adding noise
>>
>> # results in above error
>> fit = nls(yeps ~ p1 / (1 + exp(p2 - x) / p3) * exp(p4 * x))
>>
>> ###
>>
>> From what I've found in this list I think that my model is
>>> over-parameterized.
>>>
>> How can I work around that?
>>
>
> Take out p3; it's redundant.
>
> Peter Ehlers
>
> Thanks,
>>
>> Felix
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.
>>
>
>

        [[alternative HTML version deleted]]



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:05:12 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:40:29 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