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

Kyeongmi Cheon katie.cheon at gmail.com
Fri Jul 25 05:02:08 CEST 2008

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


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.

More information about the R-help mailing list