nimble
nimble copied to clipboard
enhance handling of optimization for Laplace
WIP: do not merge without discussion.
In particular @perrydv see my changes to custom_optim_inner
.
Flagging @weizhangstats @paul-vdb @kenkellner in case anyone has thoughts on item 3 below or other thoughts on readiness to merge this into devel.
This makes a few enhancements to the "laplaceRpieces" work:
- Perry added capability for inner optimization to use inner Hessian to allow use of Newton's methods
- Wei fixed a small bug in
buildOneAGHQuad
- Chris modified
custom_optim_inner
to returnNaN
rather than stopping if inner optimization fails. This allows outer optimization to proceed (e.g., in cases where BFGS tries an outer parameter value that causes inner gradients of NaN/Inf/huge values). He saw that for the CDFW carnivores example, such inner gradients occur (including when using TMB viaunmarked
), so we need robust handling of such inner optimization failures.
One open item. We have innerOptimWarning
(default of FALSE) in our Laplace system to avoid overwhelming user with warnings about problems in the inner optimization. This needs to be extended into Chris' changes to custom_optim_inner
presumably. Right now all warnings are being printed.
Also we'll presumably need to change the default inner optimization to nlminb
per NCT issue discussion.