February 26th, 2006, 5:18 am
I have only once used a QP package in matlab but it took as input matrices of inequality and equality constraints. . Making the weights sum to 1 is adding a linear equality constraint that looks like thisEquality constraint: Ax=bA = [1,1,1,1,1,1,1...]b= [1]x = weights to solve forA is 1xN matrix of 1's, where N is the number of items in the portfolio.To keep the weights explicitly non zero, you could enter N inequality constraintsInequality constraint: Cx >= dd = [0;0;0;0;...]C = identity matrixx = weights to solve fordoes this help at all?