Skip to content
Prev 86448 / 398513 Next

Using optim() with a function which returns more than a scalar - alternatives?

S??ren H??jsgaard wrote:

            
Have your function return a scalar value and any additional data in an 
attribute, and then optimise. Then call your function one more time 
using the resulting parameters found by optim(), and you'll get the 
attributes.

  Pro: No need to mess with the code of optim()
  Con: One more function call required. Probably not a problem since 
optim() will have called it a few times anyway.

BArry