Provide a check on Kuhn-Karush-Tucker conditions based on quantities already computed. Some of these used only for reporting.

1 2 |

`par` |
A vector of values for the parameters which are supposedly optimal. |

`fn` |
The objective function |

`gr` |
The gradient function |

`hess` |
The Hessian function |

`upper` |
Upper bounds on the parameters |

`lower` |
Lower bounds on the parameters |

`maxfn` |
Logical TRUE if function is being maximized. Default FALSE. |

`control` |
A list of controls for the function |

`...` |
The dot arguments needed for evaluating the function and gradient and hessian |

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.

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

`hev` |
The calculated hessian eigenvalues, sorted largest to smallest?? |

`ngatend` |
The computed (unconstrained) gradient at the solution parameters. |

`nnatend` |
The computed (unconstrained) hessian at the solution parameters. |

`optim`

1 | ```
# genrose function code
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.