Re: [Rd] Windows crash in confint() with nls fit (PR#8428)

From: <bolker_at_zoo.ufl.edu>
Date: Thu 22 Dec 2005 - 20:24:01 GMT


Duncan Murdoch wrote:
> I've found the problem, but someone who knows more about nls() will have
> to fix it.
>
> The problem is that in the demo code below, n1 ends up being an nls
> object, but n1$call$control is NULL. profiler.nls() assumed that the
> nls object passed to it has a non-NULL element there, and doesn't check.
>
> I've fixed the code so now it doesn't crash, but it now dies with this
> error instead:
>
> > confint(n1) ## boom
> Waiting for profiling to be done...
> Error in prof$getProfile() : 'control$maxiter' absent
>
> I'll commmit my change to R-devel and R-patched shortly.
>
> Duncan Murdoch
>

   thank you for the quick response!

    actually, I discovered I'm wrong -- bug affects Linux as well, gives a segmentation fault
(I must have tried it without the algorithm="port" argument by accident.) I've looked at the code but I regretfully concur that someone else will have to work on this -- I can hack nls so it reinserts a "control" element in n1$call, but $tol and $minFactor are explicitly deleted from the control list, and so we only get one step farther. I don't know what assumptions nls_iter is really making and whether it's safe to make them when the port algorithm is being used or not ...

   My best guess at this point, poking around, is that profiler.nls in src/library/stats/R/nls-profile.R has to be changed in parallel with nls to call port_nlsb instead of nls_iter when the port algorithm is being used, but this is all getting a bit deep for me ...

    Ben



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Dec 23 08:55:38 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:35 GMT