Skip to content
Prev 8747 / 63421 Next

supplying gradient to constrOptim()

On Fri, 17 Jan 2003, Roger Peng wrote:

            
In order not to need explicit gradients you need to be able to compute
them with finite differences. For general constrained optimisation the
points used for the finite differences should be inside the constraint
region (and problems will occur with the log barrier if they aren't).
With the built-in L-BFGS-B this isn't a problem -- you can find points
inside the `box' constraints to compute finite differences.  With
arbitrary linear constraints it is hard to find points in the feasible
region to compute finite difference approximations to the gradient.

If you knew that the unconstrained objective function was well-defined
just outside the constraint region it would be possible to compute a
gradient using finite differences for the objective function and
analytical gradients for the constraint part. Patches to do this would be
welcome, and it shouldn't be too hard.

	-thoms