[R] nlminb--lower bound for parameters are dependent on each others

From: Kyeongmi Cheon <katie.cheon_at_gmail.com>
Date: Thu, 24 Jul 2008 20:02:08 -0700 (PDT)

I'm trying to solve two sets of equations (each set has four equations and all of them share common parameters) with nlminb procedure. I

minimize one set and use their parameters as initial values of other set, repeating this until their parameters become very close to each other.

I have several parameters (say,param1, param2) and their constraints are given as inequality and depend on each other. For example, param1>=0, param1 + param2*c1>=0 (c1 is a known positive constant)

When I wrote my program as:


myfunction1 <-function(param ){..}
myfunction2 <-function(param ){..}


while (difference.Params>eps){

res1 <- nlminb(param.new2, myfunction1, lower = c(0, -c1/res1$par[1]), upper = Inf)

res2 <- nlminb(param.new1, myfunction2, lower = c(0, -c1/res2$par[1]), upper = Inf)

difference.Params <-max(abs(param.new1-param.new2))


I got error message:
Error in -res1$par[1] : invalid argument to unary operator Is there any way to implement this constraint? Thank you for your help in advance.


University of Memphis

View this message in context: http://www.nabble.com/nlminb--lower-bound-for-parameters-are-dependent-on-each-others-tp18644373p18644373.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Jul 2008 - 03:03:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 03:32:42 GMT.

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

list of date sections of archive