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 -- View this message in context: http://www.nabble.com/how-to-obtain-optimization-with-constraints-tf3955295.html#a11223029 Sent from the R help mailing list archive at Nabble.com.
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. > > LinPut 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