On Wed, Sep 05, 2007 at 04:43:19PM -0700, Yuchen Luo wrote: > Dear friends. > > I use nls() and encounter the following puzzling problem: > > > > I have a function f(a,b,c,x), I have a data vector of x and a vectory y of > realized value of f. > > > > Case1 > > I tried to estimate c with (a=0.3, b=0.5) fixed: > > nls(y~f(a,b,c,x), control=list(maxiter = 100000, minFactor=0.5 > ^2048),start=list(c=0.5)). > > The error message is: "number of iterations exceeded maximum of 100000" > > > > Case2 > > I then think maybe the value of a and be are not reasonable. So, I let nls() > estimate (a,b,c) altogether: > > nls(y~f(a,b,c,x), control=list(maxiter = 100000, minFactor=0.5 > ^2048),start=list(a=0.3,b=0.5,c=0.5)). > > The error message is: > > "singular gradient matrix at initial parameter estimates". > > > > This is what puzzles me, if the initial parameter of (a=0.3,b=0.5,c=0.5) can > create 'singular gradient matrix', then why doesn't this 'singular gradient > matrix' appear in Case1? > > > > I have tried to change the initial value of (a,b,c) around but the problem > persists. I am wondering if there is a way out. > > > > My another question is, I need to run 220 of nls() in my program with > different y and x. When one of the nls() encounter a problem, the whole > program stops. In my case, the 3rd nls() runs into a problem. I would > still need the program to run the remaining 217 nls( )! Is there a way to > make the program skip the problematic nls() and complete the ramaining > nls()'s?
?try > > > > Your help will be highly appreciated! > > Yuchen Luo > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch 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. ______________________________________________ R-help@stat.math.ethz.ch 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.