uhess: Wrapper for user Hessian function for optimization tools

Description Usage Arguments Details Value Examples

View source: R/uhess.R


Provides a wrapper around user analytic Hessian function for nonlinear optimization to try to control for inadmissible arguments to user that function, as well as provide for maximization.


uhess(par, fnuser)



A vector of parameters to the user-supplied function fn


A user-supplied function object that has three sub-functions fn, gr, and hess. fn generates the scalar numerical value of the objective function, gr its vector valued gradient (or is NULL) and hess a numerical matrix for the Hessian (or is NULL).


Note that a FIXED name environment opx12env is used to carry the user's fn, gr and hess and the counters.


uhess returns a matrix numeric value, but if the inputs to the function are inadmissible, all elements are set to the R constant .Machine$double.xmax and the computation of fn fails. The returned value has an attribute inadmissible which is returned TRUE in this case, but otherwise is FALSE.


cat("uhess: try an inadmissible set of parameters to a user function\n")

optfntools documentation built on May 31, 2017, 1:37 a.m.

Search within the optfntools package
Search all R packages, documentation and source code