search for: tuomivaara

Displaying 2 results from an estimated 2 matches for "tuomivaara".

2023 Aug 03
3
feature request: optim() iteration of functions that return multiple values
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 the calculations, etc. myfun <- function() { ... return(list(minimize.me = minimize.me, R2 =
2023 Aug 05
1
feature request: optim() iteration of functions that return multiple values
...: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] ans <- 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 list(ans=ans, extra1 = 1:10, extra2 = letters) } fr2 <- returnFirst(fr) tmp <- optim(c(-1.2,1), fr2) fr(tmp$par) Am 03.08.23 um 22:21 schrieb 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 interm...