[R] Nonlinear optimization with constraints

Thomas Lumley tlumley at u.washington.edu
Thu Aug 2 17:16:52 CEST 2007


On Wed, 1 Aug 2007, Patrick Burns wrote:

> If you put in penalties for breaking constraints,
> it is generally better to make the penalty depend
> on the size of the violation.  This keeps the function
> continuous (though usually not differentiable at the
> boundary), and gives the optimizer a hint about
> which way to go.

And this is what constrOptim does (though in a slightly more sophisticated 
way that keeps the function twice-differentiable at the boundary).  I 
don't know why constrOptim() isn't applicable here -- the constraint looks 
like a linear inequality to me.

 	-thomas


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-help mailing list