No. That would not work for equality constraints. This is quadratic programming problem. Check out `quadprog' or any other quad programming packages in R.
If you have more general, nonlinearly constrained optimization you can use any one of the 3 following packages: 1. `spg' function in "BB" package 2. `constrOptim.nl' or `auglag' functions in "alabama" package 3. `solnp' in "Rsolnp" package. Hope this helps, Ravi. -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng, C Sent: Tuesday, September 28, 2010 2:54 PM To: r-help@r-project.org Subject: Re: [R] constrained optimization -which package? ?constrOptim -- View this message in context: http://r.789695.n4.nabble.com/constrained-optimization-which-package-tp27176 77p2717719.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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. ______________________________________________ R-help@r-project.org mailing list 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.