Thomas Schu
2012-Oct-19 18:00 UTC
[R] Which package/function for solving weighted linear least squares with inequality and equality constraints?
Dear All, Which package/function could i use to solve following linear least square problem? A over determined system of linear equations is given. The nnls-function may would be a possibility BUT: The solving is constrained with a inequality that all unknowns are >= 0 and a equality that the sum of all unknowns is 1 The influence of the equations according to the solving process is weighted too. llAx-bll2 * weight with xi >=0 and sum(x)=1 I?m pleased about every suggestion. Thank you and best regards Thomas -- View this message in context: http://r.789695.n4.nabble.com/Which-package-function-for-solving-weighted-linear-least-squares-with-inequality-and-equality-constr-tp4646783.html Sent from the R help mailing list archive at Nabble.com.
Berend Hasselman
2012-Oct-19 18:12 UTC
[R] Which package/function for solving weighted linear least squares with inequality and equality constraints?
On 19-10-2012, at 20:00, Thomas Schu wrote:> Dear All, > > Which package/function could i use to solve following linear least square > problem? > A over determined system of linear equations is given. The nnls-function may > would be a possibility BUT: > The solving is constrained with > a inequality that all unknowns are >= 0 > and a equality that the sum of all unknowns is 1 > The influence of the equations according to the solving process is weighted > too. > > llAx-bll2 * weight > with xi >=0 and sum(x)=1 > > I?m pleased about every suggestion.Just guessing. Go to the Optimization task view on the Task Views page on CRAN: http://cran.r-project.org/web/views/ Have a look at package limSolve (Quadratic Programming). From the description I gather that it may do what you want. Berend
Thomas Schu
2012-Oct-21 10:33 UTC
[R] Which package/function for solving weighted linear least squares with inequality and equality constraints?
Dear Berend, Thank you very much for proposing the limSolve-package! The lsei function of the package is exactly what I was looking for. Best regards Thomas -- View this message in context: http://r.789695.n4.nabble.com/Which-package-function-for-solving-weighted-linear-least-squares-with-inequality-and-equality-constr-tp4646783p4646909.html Sent from the R help mailing list archive at Nabble.com.