Skip to content

constrained optimization

4 messages · gael.robert@socgen.com, Arne Henningsen, Jean Eid +1 more

#
Hello,
I've got to compute a minimization equation under an equality constraint
(Min g(x1,x2,x3) with x1+x2=const). The Constroptim function does not
authorize an equality condition but only inequality conditions. Which
function can I use instead?
Thank you very much for your help.
Gael Robert - +33 1 42 14 27 96



******************************************************************
This message and any attachments (the "message") are confide...{{dropped}}
#
On Friday 20 May 2005 17:32, gael.robert at socgen.com wrote:
You do not need constraints if you minimize
   g( x1, const - x1, x3 )
with respect to x1 and x3. After that you can calculate x2 by
   x2 = const - x1

HTH,
Arne

  
    
#
Why can't you just solve x1 in terms of x2 and plug it in..
ie. min g(const-x2, x2, x3)

Jean
On Fri, 20 May 2005 gael.robert at socgen.com wrote:

            
#
gael.robert at socgen.com wrote:

            
Hi,

What about trying to minimize, g(x1, const-x1, x3), by defining a new 
function like:

g.new <- function(para, const) g(para[1], const-para[1], para[2])

where para would be an array with 2 components, the first corresponding 
to x1 and the second to x3. Then optim(par = my.para, fn = g.new, const 
= my.const) should do the job, where my.para is the vector of initial 
guesses for x1 and x3 and my.const is the value of x1+x2.

Does that help?

Xtof.

Christophe Pouzat
Laboratoire de Physiologie Cerebrale
CNRS UMR 8118
UFR biomedicale de l'Universite Paris V
45, rue des Saints Peres
75006 PARIS
France

tel: +33 (0)1 42 86 38 28
fax: +33 (0)1 42 86 38 30
web: www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html