[R] nlm recursion problem

Bill Venables William.Venables at cmis.CSIRO.AU
Wed Sep 29 13:44:56 CEST 1999


> John Logsdon <j.logsdon at lancaster.ac.uk> writes:
> 
> > nlm is called by many functions and packages so perhaps this is quite a
> > common problem - what is the slickest way round it?  The solution required
> > is just the intercept and slope of a line where there may be censored data
> > so lm() won't do and neither will optimise() (it is only for 1 dimension
> > and I require 2).
> 
> There really is no way around this, except either to rewrite the
> maximiser in a language that allows reentrancy ( = C in practice) or
> wait for someone to write a Fortran compiler that does. We've
> previously done this for the solvers, and nlm appears to be under
> scrutiny at the moment anyway, so perhaps...
> 
Right, there is no way to make Fortran of this vintage recursive
but, much as I hesitate to point it out, if you know in advance
that all you need is two levels (as John appears to do) you could
use another Fortran routine as the inner minimizer, and there is
no reason why that one could not be the same one that sits behind
nlm by another name.  Ugly, I know, but in a jam I'd do it, and
in an Open Source system the code is sitting there, waiting...

"Fortran - just say `No'."

Bill.

-- 
-----------------------------------------------------------------
Bill Venables, Statistician, CMIS Environmetrics Project.

Physical address:                            Postal address:
CSIRO Marine Laboratories,                   PO Box 120,       
233 Middle St, Cleveland, Queensland         Cleveland, Qld, 4163
AUSTRALIA                                    AUSTRALIA

Telephone: +61 7 3826 7251     Email: Bill.Venables at cmis.csiro.au     
      Fax: +61 7 3826 7304
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list