[R] how to obtain optimization with constraints
Ben Bolker
bolker at ufl.edu
Thu Jun 21 03:12:18 CEST 2007
Lin Pan <linpan1975 <at> yahoo.com> writes:
>
>
> Hello All,
>
> I have one function f(x, y, z) and wanted to optimize the function by
> changing x, y and z values. But z has to be <= sqrt(x*y). Does anybody give
> some advise on how to do it in R? thanks a lot.
>
> Lin
Put all the parameters on the log scale
(so that log(z)- 0.5*log x -0.5*log y) <= 0),
then use constrOptim to set linear inequality constraints.
(This is assuming all the parameters are positive ...)
Ben Bolker
More information about the R-help
mailing list