Learn R Programming

optextras (version 2013-10.27)

uhess: Wrapper for user Hessian function for optimization tools

Description

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.

Usage

uhess(par, fnuser)

Arguments

par
A vector of parameters to the user-supplied function fn
fnuser
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 Hes

Value

  • 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.

encoding

UTF-8

concept

  • minimization
  • maximization

Details

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

Examples

Run this code
cat("uhess: try an inadmissible set of parameters to a user function
")

Run the code above in your browser using DataLab