Re: [R] nls convergence problem

From: Earl F. Glynn <>
Date: Wed 16 Aug 2006 - 06:45:38 EST

"Dieter Menne" <> wrote in message
> Earl F. Glynn <efg <at>> writes:
> This toy problem is exactly what the warning is for:
> Warning
> Do not use nls on artificial "zero-residual" data.
> Add some noise and try again.

Thank you!

I had adapted some code and must confess I had read ?nls.control thoroughly, but not ?nls. I had even used debug on nls, traced it through line by line to the .Call statement, trying to figure out why nls.out never got defined. The source code has no comments at all.

IMHO, the warning should be in the "Description" at the top of the ?nls page, not at the bottom of the page. The warning should also appear on the ?nls.control page. But, a better way would be to have a software design that eliminated the warning.

It's not clear to me why this problem cannot be "fixed" somehow. You shouldn't need to add noise to a problem to solve it. (It's a bit like saying addition works, but not for integers without adding some noise.) If there can be arbitrary defaults of maxiter=50, and (relative) tol=1e-5 in nls.control, there could be another arbitrary (absolute) convergence criterion. Or, maybe there's something I don't understand about the algorithm being used.

Just my $0.02 and minority opinion,
efg mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 16 07:02:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 16 Aug 2006 - 18:22:31 EST.

Mailing list information is available at Please read the posting guide before posting to the list.