f it produces an error: *singular gradient matrix at initial parameter estimates.You are watching: Singular gradient matrix at initial parameter estimates* The result is roughly a = 1.1466, b = 0.6415, so there shouldn"t be a problem with intial parameter estimates as I have defined them as a=1, b=0.5.

I have read in other topics that it is convenient to modify the curve. I was thinking about something like log y=log a *(b^x), but I don"t know how to deal with function specification. Any idea?

r curve-fitting nls

Share

Improve this question

Follow

edited Feb 17 "14 at 0:44

Vochmelka

asked Feb 16 "14 at 18:44

VochmelkaVochmelka

19911 silver badge88 bronze badges

2

Add a comment |

## 1 Answer 1

Active Oldest Votes

7

I will expand my comment into an answer.

If I use the following:

y or

(m I obtain:

As for automatically generating starting values, I am not familiar with a procedure to do that. One method I have read about is to simulate curves and use starting values that generate a curve that appears to approximate your data.

Here is the plot generated using the above parameter estimates using the following code. I admit that maybe the lower right portion of the line could fit a little better:

setwd("c:/users/mmiller21/simple R programs/")jpeg(filename = "nlr.plot.jpeg")plot(x,y) curve(1.0934^(0.7242^x), from=0, to=11, add=TRUE)dev.off()

Share

Improve this answer

Follow

edited Feb 17 "14 at 1:29

answered Feb 17 "14 at 0:59

Mark MillerMark Miller

11.5k2121 gold badges7070 silver badges123123 bronze badges

Add a comment |

## Your Answer

Thanks for contributing an answer to Stack Overflow!

Please be sure to*answer the question*. Provide details and share your research!

But *avoid* …

To learn more, see our tips on writing great answers.

See more: Read Diary Of An Oxygen Thief Read Online Free, Diary Of An Oxygen Thief By Anonymous

Draft saved

Draft discarded

### Sign up or log in

Sign up using Google

Sign up using Facebook

Sign up using Email and Password

Submit

### Post as a guest

Name

Email Required, but never shown

### Post as a guest

Name

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

## Not the answer you're looking for? Browse other questions tagged r curve-fitting nls or ask your own question.

The Overflow Blog

Featured on Meta

Linked

-3

facing error with "nlsLM" in R?

1

Nonlinear total least squares/Deming regression

Related

0

another: "singular gradient matrix at initial parameter estimates"

1

wrapnls: Error: singular gradient matrix at initial parameter estimates

3

R and NLS: singular gradient matrix at initial parameter

1

nls singular gradient matrix at initial parameter estimates

0

R: nls() error. "singular gradient matrix at initial parameter estimates"

0

R nlsModel singular gradient matrix at initial parameter estimates error initial parameter estimation problem

1

R - Singular gradient matrix at initial parameter estimates

Hot Network Questions more hot questions

Question feed

Subscribe to RSS

Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-r

Stack Overflow

Products

Company

Stack Exchange Network

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.11.11.40730

Stack Overflow works best with JavaScript enabled

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.