[R] avoiding termination of nls given convergence failure

2009-03-12 Thread Bill Shipley
Hello. I have a script in which I repeatedly fit a nonlinear regression to a series of data sets using nls and the port algorithm from within a loop. The general structure of the loop is: for(i in 1:n){ … extract relevant vectors of dependent and independent variables … … estimate starting

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Joshua Reich
Hi Bill, You should have a look at the try() function that lets you enclose an expression and handle failure in a way that prevents the entire execution from halting. Josh On Thu, Mar 12, 2009 at 1:13 PM, Bill Shipley bill.ship...@usherbrooke.cawrote: Hello. I have a script in which I

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Gabor Grothendieck
If the goal here is to repeatedly run a particular model from different starting values then the nls2 package will do that for you. On Thu, Mar 12, 2009 at 2:13 PM, Bill Shipley bill.ship...@usherbrooke.ca wrote: Hello.  I have a script in which I repeatedly fit a nonlinear regression to a

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Ravi Varadhan
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bill Shipley Sent: Thursday, March 12, 2009 2:13 PM To: R-help Subject: [R] avoiding termination of nls given convergence failure Hello