[R] Nelder-Mead with output of simplex vertices

Ravi Varadhan rvaradhan at jhmi.edu
Sun Oct 11 01:40:18 CEST 2009


Ted,

I have written an R function that implements C.T. Kelley's algorithm (described in his book).  I have tested this on many problems, smooth and non-smooth, and in all my testing, I have found it to be clearly superior to optim's Nelder-Mead.  You can easily change this code to look at the evolution of the simplex.  I can send this to you, if you are interested.

Ben - can you please send me your translation from NR?  I would like to compare it to my function.  Thanks in advance.

Best,
Ravi.

____________________________________________________________________

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu


----- Original Message -----
From: Ben Bolker <bolker at ufl.edu>
Date: Saturday, October 10, 2009 7:23 pm
Subject: Re: [R] Nelder-Mead with output of simplex vertices
To: r-help at r-project.org


>   I have a pure-R implementation of the N-M simplex translated from
> the C code in Press et al 1994 (Numerical Recipes), instrumented to
> save the progress.  Since I'm not sure of the copyright status (NR's
> code does not allow redistribution, but this is a translation ...) 
> I'll send
> it in separate e-mail.
> 
> 
> Ted.Harding-2 wrote:
> > 
> > Greetings!
> > I want to follow the evolution of a Nelder-Mead function
> > minimisation (a function of 2 variables). Hence each simplex
> > will have 3 vertices.
> > 
> > Therefore I would like to have a function which can output
> > the coordinates of the 3 vertices after each new simplex
> > is generated. However, there seems to be no way (which I can
> > detect) of extracting this information from optim() (the 'trace'
> > argument to 'control' does not seem to have provision for this,
> > according to '?optim', and I have tried it out without success).
> > 
> > I have had a good search through the R resources without finding
> > anything of the kind.
> > 
> > Of course I could write my own implementation of Nelder-Mead in R,
> > and generate the required output in my own way, but I would prefer
> > to learn that this is already been done!
> > 
> > Any suggestions?
> > With thanks,
> > Ted.
> > 
> > --------------------------------------------------------------------
> > E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> > Fax-to-email: +44 (0)870 094 0861
> > Date: 10-Oct-09                                       Time: 22:26:16
> > ------------------------------ XFMail ------------------------------
> > 
> > ______________________________________________
> > R-help at r-project.org mailing list
> > 
> > PLEASE do read the posting guide
> > 
> > and provide commented, minimal, self-contained, reproducible code.
> > 
> > 
> 
> -- 
> View this message in context: 
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 
> PLEASE do read the posting guide 
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list