Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0508040402671011ea@mail.gmail.com>
Date: 2005-08-04T11:02:26Z
From: Gabor Grothendieck
Subject: optim
In-Reply-To: <42F05039@webmail.ncl.ac.uk>

Check out:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/18289.html

On 8/4/05, nwew <W.E.Wolski at newcastle.ac.uk> 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.
> 
> ______________________________________________
> R-help at 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
>