From: nwew <W.E.Wolski_at_newcastle.ac.uk>

Date: Thu 04 Aug 2005 - 19:57:43 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Aug 04 20:03:32 2005

Date: Thu 04 Aug 2005 - 19:57:43 EST

Dear R-helpers,

The function optim implements algorithms that I would like to use.

I have function implemented in R, which given the parameters of which minimization is to take place returns a scalar as well as the gradient.

Unfortunately optim requires two function _fn_ and _gr_ where fn returns the function value and gr the gradient. Splitting my function in two functions would be easy, however I am wondering if evaluating both is not doubling the the very high computational costs. Most of the computational intensive operations are identical if computing the function value and gradient.

Question: is there a way to tweek optim that only one function evaluation is necessary? Are ther other implementations of the algorithm, which do assume that the function to be minimized returns the function value and the gradient as well?

Thanks

Eryk.

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Aug 04 20:03:32 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:39:40 EST
*