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

2023-08-08 Thread Sami Tuomivaara
Thank you all very much for the suggestions, after testing, each of them would be a viable solution in certain contexts. Code for benchmarking: # preliminaries install.packages("microbenchmark") library(microbenchmark) data <- new.env() data$ans2 <- 0 data$ans3 <- 0 data$i <- 0 data$fun.value

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

2023-08-03 Thread Sami Tuomivaara
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 the minimization, informative intermediate values from th