1
$\begingroup$

Sorry if this seems stupid. I was wondering what the difference between a group and inequality constraint is in Matlab. As far as I can tell they are the same:

From Matlab (http://uk.mathworks.com/help/finance/setgroups.html)

Set Group Constraints for a Portfolio Object Suppose you have a portfolio of five assets and you want to ensure that the first three assets constitute at most 30% of your portfolio. Given a Portfolio object p, set the group constraints with the following.

G = [ true true true false false ]; p = Portfolio; p = setGroups(p, G, [], 0.3);

disp(p.NumAssets); disp(p.GroupMatrix); disp(p.UpperGroup);

 5

 1     1     1     0     0

0.3000

Also from Matlab (http://uk.mathworks.com/help/finance/setinequality.html)

Set Linear Inequality Constraints for a Portfolio Object Suppose you have a portfolio of five assets and you want to ensure that the first three assets are no more than 50% of your portfolio. Given a Portfolio object p, set the linear inequality constraints with the following.

A = [ 1 1 1 0 0 ]; b = 0.5; p = Portfolio; p = setInequality(p, A, b);

disp(p.NumAssets); disp(p.AInequality); disp(p.bInequality);

 5

 1     1     1     0     0

0.5000

Am I misunderstanding something here?

$\endgroup$
1
$\begingroup$

This is a subtle point in Mathematical Optimization. The point is: in a "group constraint" the coefficients in the constraint are (implicitly) all equal to 1. In a linear inequality constraint the coefficients can be anything, although in the specific example given they are equal to one (nevertheless in general you can set them to anything you wish by assigning to the variable A).

Internally group constraints are handled specially, which makes the implementation more efficient (the program don't have to store the coefficients for one thing), especially if you have large numbers of them. The general linear constraints are handled as any linear inequality is in LP or QP. If you are not concerned about maximum program efficiency this does not matter to you and you could use the general type constraints always.

The special fast programming techniques that are used internally to deal with Group Constraints are called GUB (Generalized Upper Bound) and VUB (Variable Upper Bound). As you can see from the manual Group Constraints are a new feature that was added to MATLAB in 2011.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.