Ricardo Zorzetto Nicoliello Vencio
2004-Apr-27 11:59 UTC
[R] constrOptim does ineq, not eq, but who do ?
Hi everybody, please, could you give me help ? I scanned the help archives and didn't found hints... I want to solve a large sparse linear system subjected to an inequality constrains (all solutions positive) and an equality constrain (all solutions sum to 1), thus I tried to fool constrOptim using: x[1] + 0 + ... + 0 >= 0 ... 0 + 0 + ... + x[n] >= 0 x[1] + x[2] + ... + x[n] >= 1 -x[1] - x[2] - ... - x[n] >= -1 in minimization: min( dist(A*x - b) ) But, since the initial guess x0 must be in the fasiable region and NOT in the boundaries (due to trick I only have boundary), this trick doens't work out. If constrOptim doesn't make subject to equalities, what function could do this optimization ? any ideia ? I look for something similar to MATLAB's lsqlin function: http://web.media.mit.edu/~bill/workspace/matlab/toolbox/optim/lsqlin.html
Dear Ricardo, Optimization of the surrogate function that is used in the constrOptim under equality constraints can be implemented by applying the lagrangian rule to the surrogate function (instead of using 'optim'). The iterative formula can be found in Lange, K. (1999). Numerical analysis for statisticians. Springer-Verlag, New York. pp: 184. I hope this helps. Roula ----- Original Message ----- From: "Ricardo Zorzetto Nicoliello Vencio" <rvencio at ime.usp.br> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, April 27, 2004 1:59 PM Subject: [R] constrOptim does ineq, not eq, but who do ?> Hi everybody, > > please, could you give me help ? I scanned the help archives anddidn't> found hints... > > I want to solve a large sparse linear system subjected to aninequality> constrains (all solutions positive) and an equality constrain (all > solutions sum to 1), thus I tried to fool constrOptim using: > > x[1] + 0 + ... + 0 >= 0 > ... > 0 + 0 + ... + x[n] >= 0 > x[1] + x[2] + ... + x[n] >= 1 > -x[1] - x[2] - ... - x[n] >= -1 > > in minimization: min( dist(A*x - b) ) > > But, since the initial guess x0 must be in the fasiable region andNOT in> the boundaries (due to trick I only have boundary), this trickdoens't> work out. > > If constrOptim doesn't make subject to equalities, what functioncould do> this optimization ? any ideia ? > > I look for something similar to MATLAB's lsqlin function: >http://web.media.mit.edu/~bill/workspace/matlab/toolbox/optim/lsqlin.html> > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html