[R] lsqlin in pracma

Berend Hasselman bhh at xs4all.nl
Sat Aug 29 20:53:46 CEST 2015


> On 29 Aug 2015, at 18:29, Ravi Varadhan <ravi.varadhan at jhu.edu> wrote:
> 
> In solve.QP(), you don't need to expand the equality into two inequalities.  It can DIRECTLY handle the equality constraints.  The first `meq' rows of the constraint matrix are equality constraints. Here is the excerpt from  the documentation.
> 
> meq
> the first meq constraints are treated as equality constraints, all further as inequality constraints (defaults to 0).
> 
> 
> Therefore, solve.QP() can provide the full functionality of lsqlin in Matlab.  However, one caveat is that the bounds constraints have to be implemented via inequalities in solve.QP(), which is a slight pain, but not a deal breaker.
> 

It would be helpful if you could show us how to use solve.QP() in this case.
I’ve been trying with no success.

Berend



More information about the R-help mailing list