[R] linear constraint optim with bounds/reparametrization
Ingmar Visser
i.visser at uva.nl
Tue Aug 10 10:42:50 CEST 2004
On 8/9/04 4:52 PM, "Thomas Lumley" <tlumley at u.washington.edu> wrote:
> On Mon, 9 Aug 2004, Kahra Hannu wrote:
>
>>> 1) constrOptim does not work in this case because it only fits inequality
>>> constraints, ie A%*%theta > = c
>> --- I was struggling with the same problem a
>> few weeks ago in the portfolio optimization context. You can impose
>> equality constraints by using inequality constraints >= and <=
>> simultaneously. See the example bellow.
>>
>
> Ick. You do not want to use constrOptim for equality constraints.
> constrOptim is a log-barrier interior-point method, meaning that it adds
> a multiple of log(A%*%theta-c) to the objective function. This is a really
> bad idea as a way of faking equality constraints.
>
> Use Lagrange multipliers and optim.
Is there a package that does all that for me? Or is there example code that
does something similar?
ingmar
More information about the R-help
mailing list