I have a vector A
of length N
. Also I have N*N
matrix C
. I want to maximize following equation :
minimize (- (w_transpose * A) + p * w_transpose * C * w)
Where w
is a vector of length N
, with constraints that each w
is non-negative and sum of all w
is 1.
I have seen a package called quadProg
. There I need to specify :
Dmat = C
, dvec = A
, and bvec = w
but not sure how to apply above mentioned constraints there.
I suppose I could provide Amat
to be an identity matrix, which will keep all w
non-negative. But not sure how to keep w
normalized (sum equal to zero). Actually I could normalize them later as well, but still wondering if I can do it here itself.