[R] lb and ub for variables - nloptr

Narendra Modi bjpmodi2016 at gmail.com
Mon Oct 17 20:46:48 CEST 2016

Hello All,
I use nloptr to perform optimization.
In one example,the lb for each variable is 0 and ub is Inf during the first run.

x <- c(10,10,10,10) # initial values
lb <- c(0,0,0,0)
ub <- c(Inf,Inf,Inf,Inf)

optimised.answer  = 4.2,0.001,20,21

To run the second time for a better match, I set a condition in the ub
matrix saying if the value of any of optimized variable in the first
run is less than 0.01, set the ub for that variable as 0; both lb and
ub for that variable is 0. So I expect that during the second run,
this variable is not varied by the optimizer at all.

i.e. new.x <- c(4.2,0,20,21)
But when I run the optimizer the second time with the "new.x",all the
above variable is still varied by the optimizer!

Is there anyway to not have the second variable varied?


More information about the R-help mailing list