Description Usage Arguments Details Value See Also Examples
Provide a check on Kuhn-Karush-Tucker conditions based on quantities already computed. Some of these used only for reporting.
1 |
par |
A vector of values for the parameters which are supposedly optimal. |
fval |
Function value at parameters |
ngr |
Gradient (possibly estimated) of the function at |
nHes |
Matrix that is supposedly the Hessian at |
nbm |
Number of active masks or bounds on |
maxfn |
Logical TRUE if function is being maximized. Default FALSE. |
control |
A list of controls for the function, made up of the following items |
kkttolA tolerance for the KKT gradient check.
kkt2tolA tolerance used for the KKT Hessian check.
ktraceA logical flag that, if TRUE, displays intermediate information on the progress of the function. Default is FALSE.
At the moment, kktc does NOT handle box constraints or masks in its
tests, except to ignore the dimensions for masks (not active bounds).
The present code was developed by lifting it from optimx
so that KKT checks could be added to other optimization routines.
Note that we IGNORE the sign of the gradient in the case that the
objective is being maximized. We do account for the sign of the
Hessian for curvature however.
The output is a list consisting of
gmax |
The absolute value of the largest gradient component in magnitude. |
evratio |
The ratio of the smallest to largest Hessian eigenvalue. Note that this may be negative. |
kkt1 |
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. |
kkt2 |
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. |
1 | # genrose function code
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.