Provide a check on Kuhn-Karush-Tucker conditions based on quantities already computed. Some of these used only for reporting.
kktchk(par, fn, gr, hess=NULL, upper=NULL, lower=NULL,
maxfn=FALSE, control=list(), ...)A vector of values for the parameters which are supposedly optimal.
The objective function
The gradient function
The Hessian function
Upper bounds on the parameters
Lower bounds on the parameters
Logical TRUE if function is being maximized. Default FALSE.
A list of controls for the function
The dot arguments needed for evaluating the function and gradient and hessian
The output is a list consisting of
The absolute value of the largest gradient component in magnitude.
The ratio of the smallest to largest Hessian eigenvalue. Note that this may be negative.
A logical value that is TRUE if we consider the first (i.e., gradient) KKT condition to be satisfied. WARNING: The decision is dependent on tolerances and scaling that may be inappropriate for some problems.
A logical value that is TRUE if we consider the second (i.e., positive definite Hessian) KKT condition to be satisfied. WARNING: The decision is dependent on tolerances and scaling that may be inappropriate for some problems.
The calculated hessian eigenvalues, sorted largest to smallest??
The computed (unconstrained) gradient at the solution parameters.
The computed (unconstrained) hessian at the solution parameters.
kktchk computes the gradient and Hessian measures for BOTH unconstrained and bounds (and masks) constrained parameters, but the kkt measures are evaluated only for the constrained case.
# NOT RUN {
# genrose function code
# }
Run the code above in your browser using DataLab