Dear list, I am looking for an R-only implementation of a Nelder-Mead process that can find local maxima of a spatially distributed variable, e.g. height, on a spatial grid, and outputs the coordinates of the new point during each evaluation. I have found two previous threads about this topic, and was wondering if something similar has been implemented since those messages were posted. Thank you for any suggestions how to approach this task or where to look. Juliane Previous posts: www.mail-archive.com/r-help@r-project.org/msg13078.html http://www.nabble.com/Nelder-Mead-with-output-of-simplex-vertices-tp25838572p25869383.html Dr. Juliane Struve Environmental Scientist 10, Lynwood Crescent Sunningdale SL5 0BL 01344 620811 [[alternative HTML version deleted]]
Juliane Struve wrote:> Dear list, > > I am looking for an R-only implementation of a Nelder-Mead process that can find local maxima of a spatially distributed variable, e.g. height, on a spatial grid, and outputs the coordinates of the new point during each evaluation. I have found two previous threads about this topic, and was wondering if something similar has been implemented since those messages were posted. > > Thank you for any suggestions how to approach this task or where to look. > > Juliane > > Previous posts: > > www.mail-archive.com/r-help at r-project.org/msg13078.html > http://www.nabble.com/Nelder-Mead-with-output-of-simplex-vertices-tp25838572p25869383.html > > Dr. Juliane Struve > Environmental Scientist > 10, Lynwood Crescent > Sunningdale SL5 0BL > 01344 620811 > > > > [[alternative HTML version deleted]] > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Hi, Look at the optim() function, it has Nelder-Mead implemented. cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul
The optim function has a debug option called trace see the helppage: trace Non-negative integer. If positive, tracing information on the progress of the optimization is produced. Higher values may produce more tracing information: for method "L-BFGS-B" there are six levels of tracing. (To understand exactly what these do see the source code: higher levels give more detail.) for Nelder-Mead this outputs quite a bit of information. You would only need more if you were debugging optim, as a user if you think visualizing how the damned thing walks will help you understand your problem better, you are probably onto the wrong path. That said, you seem to have data which is defined on a grid, the appropriate method in this case in SANN, not Nelder-Mead. Hope this helps, K ----------------------------------------------- Nanjing University tel: +8625 8622 8040 (h) +86 13451911944 (m)