Re: [R] optim

From: Gabor Grothendieck <>
Date: Thu 04 Aug 2005 - 21:02:26 EST

Check out:

On 8/4/05, nwew <> wrote:
> 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.
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Thu Aug 04 21:15:28 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:04:00 EST