canmod / macpan2

Rebuilding https://github.com/mac-theobio/McMasterPandemic/
https://canmod.github.io/macpan2/
GNU General Public License v3.0
2 stars 0 forks source link

optim default should be BFGS because we always have gradients thanks to TMB #81

Open stevencarlislewalker opened 1 year ago

stevencarlislewalker commented 1 year ago

From @bbolker.

The Nelder-Mead default for optim exists because it is a good method for more than one argument to be optimized in the case when no derivatives are available. When one argument is optimized the Nelder-Mead method throws a warning, which makes for a bad experience given that we always have derivatives (thanks to TMB) and therefore should never be using Nelder-Mead anyways.

bbolker commented 1 year ago

It's a warning, not an error, but otherwise I agree.

stevencarlislewalker commented 1 year ago

Thinko! Thanks @bbolker