I am trying to view the source code of the function nlm in the stats package of R 2.4.1. I downloaded the source from CRAN and opened nlm.R, and it calls a .Internal function: .Internal(nlm(function(x) f(x, ...), p, hessian, typsize, fscale, msg, ndigit, gradtol, stepmax, steptol, iterlim)) This is the same thing I saw when entering the function name at the R command prompt. Where will I find the actual code? Thanks.
On 1/15/2008 9:37 AM, Sarah Touati wrote:> I am trying to view the source code of the function nlm in the stats > package of R 2.4.1. > > I downloaded the source from CRAN and opened nlm.R, and it calls a > .Internal function: > > .Internal(nlm(function(x) f(x, ...), p, hessian, typsize, fscale, > msg, ndigit, gradtol, stepmax, steptol, iterlim)) > > This is the same thing I saw when entering the function name at the R > command prompt. Where will I find the actual code?Uwe Ligges wrote about this in R-news, in this issue: http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf, page 43. You need to find the C code corresponding to nlm. That is the do_nlm routine in src/main/optimize.c, but naturally enough, it calls a lot of lower level routines. Duncan Murdoch
Reasonably Related Threads
- nlm and optional arguments
- Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
- Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
- typsize and fscale arguments to nlm
- Understanding nonlinear optimization and Rosenbrock's banana valley function?