From Peter.Ruckdeschel at uni-bayreuth.de  Tue May  2 11:34:06 2006
From: Peter.Ruckdeschel at uni-bayreuth.de (Peter Ruckdeschel)
Date: Tue, 02 May 2006 11:34:06 +0200
Subject: [Rd] optimize() and extrema at the interval bounds
Message-ID: <4457278E.2000703@uni-bayreuth.de>

Dear r-devels,

by construction, optimize() only evaluates the objective function
*inside* the bounds of argument 'interval'.

It does not seem to be an 'extremely' rare case that extrema are attained
*at* the bounds of argument 'interval' :-)

It is fairly easy to write a wrapper to optimize()
enforcing an evaluation of the objective function at these
bounds, too, but wouldn't it be a good idea to a add an
extra argument 'evalbounds' of optimize() defaulting to FALSE
(behavior of optimize() as it is now), but which if TRUE
does evaluate the objective at the bounds?

I do not know how costly two extra evaluations are in general
as to computation time at evaluation of optimize(), nor
how many conflicts of unmatched arguments an extra argument
to optimize() would cause; so consider this just as a proposal.

Thank you for your attention,
Peter



[Rd] optimize() and extrema at the interval bounds
Peter Ruckdeschel