Hi Livia and everyone, Did you ever get a response on this question from last year (Jan 2008)? I am also looking for more explanatory documentation on the ui and ci parameters for the function constrOptim(). The examples provided in the R help and the full reference manual are not working for me. Goodle and Nabble searches have not resulted in any explanation that reads like a manual. How are ui and ci applied to the function passed into constrOptim()? How can ui and ci be written such that some but not all of the parameters (the first argument of the function call) are constrained to be between 2 values? If no additional documents exist, then that would be good to know also. Any pointer or advice would be useful. Thank you! Stu ****Original posting***** by <http://www.nabble.com/user/UserProfile.jtp?user=802522> livia Jan 15, 2008; 05:58am Hello everyone, I would like to maximize the following function fqp with linear constraits and the codes are as following: a= c(0.2,0.3,0.4) vcov=matrix(c(1,2,3,4,5,6,7,8,9),3,3) fqp <- function(b) {t(b)%*%a-0.5*((t(b)%*%vcov)%*%b)} constrOptim(c(b1,b2,b3), fqp,NULL,ui=?, ci=?, control=list(fnscale=-1)) The linear constrait is like abs(b1)+ abs(b2)+abs(b3) <= 1.5. How can I set "ui" and "ci"? Could anyone give me some advice? Many thanks. [[alternative HTML version deleted]]