swihart / gnlrim

Generalized Nonlinear Random Intercept Models in R aka a freestanding `repeated::gnlmix()`
0 stars 0 forks source link

A better default method than `nlminb`...? #14

Open swihart opened 6 years ago

swihart commented 6 years ago

https://nashjc.wordpress.com/2016/11/20/choosing-which-method-to-use-for-optimizating-functions/

Let us set some logical variables to define our problem:

I have the last two. I don't have the first.

STEP2: RUNNING A METHOD

bounds TRUE, haveg FALSE: try nmkb() from package dfOptim, but note that the transfinite function approach to bounds in this method cannot have x0 — in fact any initial parameter — on a bound. bobyqa() from package minqa may be much more efficient, but can behave poorly. hjkb() from package dfOptim is very easy to understand, but sometimes stalls and generally inefficient.

So maybe try nmkb(), bobyqa, or hjkb() ? I think I'm handling masks ok...for now... in a way that is independent of optimizer (well, except L-BFGS-B bombs) (??)

swihart commented 6 years ago

masks aren'[t ready via optimr anyway:

https://cran.r-project.org/web/packages/optimr/optimr.pdf

Method "Rcgmin" is from the package of that name. It implements a conjugate gradient algorithm with the Dai and Yuan update (2001) and also allows bounds constraints on the parameters. (Rcgmin also allows mask constraints – fixing individual parameters – but there is as yet no interface from "optimr".) Method "Rvmmin" is from the package of that name. It implements the same variable metric method as the base optim() function with method "BFGS" but allows bounds constraints on the parameters. (Rvmmin also allows mask constraints – fixing individual parameters – but there is as yet no interface from "optimr".)