Prof J C Nash (U30A)
2015-Jun-02 13:21 UTC
[R] Imposing linear binding constraint while using Rcgmin
I wrote Rcgmin to do bounds constraints only. Linear constraints are much more complicated to include. If your constraints are equality ones, you could "solve", but that could make it awkward to evaluate the gradient. For inequality constraints, especially if there are only a couple, I think I'd try a penalty or barrier function. They tend to mess up the scaling and slow things down, but generally give some idea of solutions. Penalty function adds a penalty factor * "violation". Note that gradient may need attention. i.e. penalizes being "outside" the constraint. No use if you end up trying log(-something) or sqrt(-something). Barrier adds cost "inside" the constraint to keep away from the constraint. Generally you want it to be very small except "close", and that is controlled by barrier control parameter. Again, you need to watch the gradient is provided properly. If possible avoid using numerical gradients for the penalty or barrier because of the compromised scaling, though I would use them for a quick and dirty test. JN> > Message: 18 > Date: Tue, 2 Jun 2015 01:33:55 +0530 > From: Rajarshi Bhadra <bhadrarajarshi9 at gmail.com> > To: r-help at r-project.org > Subject: [R] Imposing linear binding constraint while using Rcgmin > Message-ID: > <CAFOno_aNQsXjiT4Z+9Koxig=7ji83Lzv9e4iVXqVxLX+xGHXzg at mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > Is there any way by which I can impose a linear binding constraint while > using Rcgmin for a non linear optimization exercise? > > [[alternative HTML version deleted]] >