[R] Constraints in Quadprog

Serguei Kaniovski kaniovsk at wifo.ac.at
Tue Nov 29 16:24:01 CET 2005


I'm having difficulty figuring out how to implement the
following set of constraints in Quadprog:

1). x1+x2+x3+x4=a1
2). x1+x2+x5+x6=a2
3). x1+x3+x5+x7=a3
4). x1+x2=b1
5). x1+x3=b2
6). x1+x5=b3

for the problem: MIN (x1-c1)2+(x2-c2)2+...+(x8-c8)2.

As far a I understand, "solve.QP(Dmat, dvec, Amat, bvec, meq=0,
factorized=FALSE)" reads contraints using an element-by-element
multiplication, i.e. Amat'*x, not using the matrix-product, i.e. 
Amat'%*%x, required for the sums on the left-hand-side of 1-6).

I would very much appreciate a suggestion on this problem.

Thank you,
Serguei Kaniovski




More information about the R-help mailing list