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:
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.
[[alternative HTML version deleted]]
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 04:15:15 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.