Skip to content

Non-Linear Optimization - Query

3 messages · Lars Bishop, Paul Smith, Ravi Varadhan

#
On Tue, Mar 17, 2009 at 12:09 AM, Lars Bishop <lars52r at gmail.com> wrote:
Are your objective function and your constraint differentiable? If so,
then construct the Lagrangean and get the system of equations for
calculating the first order conditions. This nonlinear system of
equations can be solved with the package BB (by  Ravi Varadhan).

Paul
#
Hi Lars,

The approach suggested by Paul Smith is one way to try and solve your problem.  

Another aproach is to try and eliminate, if possible, one of the variables using the equality constraint, so that the problem now become unconstrained in (p-1) dimensions (where p is the original dimension).  Now you can use optim() or nlminb() or spg() in the "BB" package.

A third approach, closely related to Paul's solution is to use the Lagrangian multiplier and convert your problem to an unconstrained one.  Note that if your objective function is f(x) and your constraint is g(x) = 0, then your unconstrained objective function is:  h(x) = f(x) + \lambda * [g(x)]^2.  Start with a small value of lambda, say, 0.01 or something like that (how small depends on the scale of f(x)), and minimize h(x).  Now, increase lambda by a factor of 10, and minimize h(x) again, but now you may use the solution from the previous step as starting values .  Repeat this until paramaters converge.  If you have box-constraints on x, they can be incorporated in optim() or nlminb() or spg().

Without knowing the specifics of the problem, it is hard to give more guidance.

Ravi.
____________________________________________________________________

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu


----- Original Message -----
From: Paul Smith <phhs80 at gmail.com>
Date: Monday, March 16, 2009 9:57 pm
Subject: Re: [R] Non-Linear Optimization - Query
To: r-help at r-project.org