From: Spencer Graves <spencer.graves_at_pdf.com>

Date: Tue 18 Jul 2006 - 15:49:01 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 18 17:06:57 2006

Date: Tue 18 Jul 2006 - 15:49:01 EST

I had good luck translating constrained into unconstrained problems and then optimizing the unconstrained problem. Have you tried something like the following:

z = c(z1, z2, z3), where p1=1/(1+exp(-z1), etc. This translates the constraints on the p's to

G(z) = P*(f1(z)-r12*f2(z))^2-f1(z)

Hope this helps, Spencer Graves

Iris Zhao wrote:

> Dear all,

*>
**>
**>
**> I am working on optimization problem and have some trouble running optim().
**> I have two functions (f1, f2) and 4 unknown parameters (p1, p2, p3, p4).
**> Both f1 and f2 are functions of p1, p2, and p3, denoted by f1(p1, p2, p3)
**> and f2(p1,p2,p3) respectively.
**>
**>
**>
**> The goal is to maximize f1(p1, p2, p3) subject to two constraints:
**>
**> (1) c = k1*p4/(k1*p4+(1-k1)*f1(p1,p2,p3)), where c and k1 are some known
**> constants
**>
**> (2) p4 = f2(p1, p2, p3)
**>
**> In addition, each parameter ranges from 0 to 1, and both f1 and f2 involve
**> integrations.
**>
**>
**>
**> I tried to use lagrange multipliers to eliminate two equality constraints
**> and then use optim() to find the maximum value and optimal parameter
**> estimates.
**>
**> So I let fn be f1+lambda1*(c- k1*p4/(k1*p4+(1-k1)*f1(p1,p2,p3))) +
**> lambda2(p4-f2(p1,p2,p3)). The error message I got was "Error in fn(par, ...)
**> : recursive default argument reference."
**>
**>
**>
**> I wonder whether current build-in functions in R can do this type of jobs.
**> Any suggestion will be greatly appreciated.
**>
**>
**>
**> Iris
**>
**> [[alternative HTML version deleted]]
**>
**> ______________________________________________
**> R-help@stat.math.ethz.ch mailing list
**> https://stat.ethz.ch/mailman/listinfo/r-help
**> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
*

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 18 17:06:57 2006

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Sat 22 Jul 2006 - 08:15:49 EST.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*