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

bolker@zoo.ufl.edu bolker at zoo.ufl.edu
Thu Dec 22 21:24:01 CET 2005


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



More information about the R-devel mailing list