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? NM ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.