[R] optim, L-BFGS-B | constrained bounds on parms?

Evan Cooch evan.cooch at gmail.com
Fri Sep 19 17:34:46 CEST 2014

On 9/19/2014 11:32 AM, Prof J C Nash (U30A) wrote:
> One choice is to add a penalty to the objective to enforce the
> constraint(s) along with bounds to keep the parameters from going wild.
> This generally works reasonably well. Sometimes it helps to run just a
> few iterations with a big penalty scale to force the parameters into a
> feasible region, though a lot depends on the particular problem in my
> experience, with some being straightforward and others needing a lot of
> fiddle.
> I suspect a math programming approach is overkill, though R does have
> some packages for that. Your mileage may vary.
> Note that L-BFGS-B used by R is a version for which Nocedal et al.
> reported a bug in 2011 and provided a new Fortran code. I've recently
> put up an implementation of the new code on r-forge under the optimizer
> project. Still testing, but I think it's OK. You could also use Rvmmin
> that has bounds, or nmkb from dfoptim (though you cannot start on bounds).
> Best, JN

Thanks very much. I've found that for most of my current problems, 
optimx is working well, but there are trade-offs. Good to have multiple 
options in the toolkit.


More information about the R-help mailing list