[R] nonlinear constrained optimization

Ravi Varadhan RVaradhan at jhmi.edu
Tue Aug 19 20:37:39 CEST 2008


The "Tango project" website (from Brazil) has some R functions to implement
Algencan.  I haven't used it, but I would be interested to hear others'
experience if someone has already used it or will be using it.


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Paul Smith
Sent: Tuesday, August 19, 2008 12:57 PM
To: r-help at r-project.org
Subject: Re: [R] nonlinear constrained optimization

On Tue, Aug 19, 2008 at 8:35 AM, Chua Siang Li
<siang.li.chua at acceval-intl.com> wrote:
>   Hi.  I need some advises on how to use R to find pi (i is the index)
>   the following objective function and constraint:
>   max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ]
>   s.t.  (sum i)[ f(ai, bi, pi) * Di * pi] / (sum i)[ f(ai, bi, pi) * Di ]
>   constant
>   f and g are diffentiable.
>   So, I am thinking of optim with method = "BFGS"? But wonder how to
>   the constraint.
>   I also saw constrOptim but it says for linear constraint only.
>   So, what will be the suitable function to use then?
>   Also, how should I write (sum i) in R?
>   Many thanks and your help is much appreciated.

Up to my best knowledge, R cannot deal with optimization problems with
nonlinear constraints, unless one uses the penalty method. Outside R, Ipopt
and Algencan can solve problems like yours, but one needs to program in AMPL
and/or C/Fortran.


R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list