Hallo, I'm trying to optimize a function A which calls another function B
internally.
This function A has got two input parameters, say a1 and a2.
Using OPTIM there ist no problem restricting these parameters:
0 = a1 = 1 and 0 = a2 = 1.
My problem is an additional restriction
0 = a1+a2 = 1.
You could reparametrize or use constrOptim,
Hth, Ingmar
From: Florian Staab [EMAIL PROTECTED]
Date: Mon, 29 May 2006 12:08:59 +0200
To: r-help@stat.math.ethz.ch
Subject: [R] parameter-restrictions in OPTIM
Hallo, I'm trying to optimize a function A which calls another function B
One trick is to add a penalty to your function for
violations of the linear constraint. However, if the
constraint is binding, then gradient methods may
not perform well since the objective won't be
differentiable there. If the constraint looks to be
binding, then you can reparameterize to a