Re: [Rd] feature request: optim() iteration of functions that return multiple values

2023-08-04 Thread Duncan Murdoch
Enrico gave you a workaround that stores the extra values in an environment. Another possible workaround is an optional argument to myfun() that asks it to return more information, e.g. fr <- function(x, data, extraInfo = FALSE) { ## Rosenbrock Banana function x1 <- x[1]

Re: [Rd] feature request: optim() iteration of functions that return multiple values

2023-08-04 Thread Enrico Schumann
On Thu, 03 Aug 2023, Sami Tuomivaara writes: > Dear all, > > I have used optim a lot in contexts where it would > useful to be able to iterate function myfun that, in > addition to the primary objective to be minimized > ('minimize.me'), could return other values such as > alternative metrics of t