Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-08-02 07:51:17


Sohail Somani wrote:
> If I can only suggest: Decouple evaluation of the objective function
> from its derivatives. Or have another concept that is not callable.
>
> I have an example of how one can specify a family of functions and
> their derivatives:
>
> http://sohail.taggedtype.net/software/newton_raphson.cxx
>
> You can blame the idle hands for this one.

:-)

I see what you're doing, but I deliberately wanted the derivatives to be
calculated at the same time as f(x): the functions I was interested in
(incomplete beta and gamma's) have terms that are common to both the
derivative and the objective function, and I wanted the option of
calculating both the derivatives and the objective function at the same
time. Now as it happens, I haven't got around to using this leeway yet,
although I certainly do use it to advantage where the second derivative is
concerned (it's way cheaper to calculate the second derivative from the
first than from scratch).

In any case if the derivative is unavailable or expensive to compute, then I
would be inclined to use a method specifically optimised for that situation
like the one of Alefeld et al (see toms748_solve in
http://freespace.virgin.net/boost.regex/toolkit/libs/math/doc/html/math_toolkit/toolkit.html#math_toolkit.toolkit.root_finding_without_derivatives)
rather than a discrete Newton-Raphson method.

Just my 2c....

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk