Skip to content
All library documents

Group Constraints Versus Linear Inequalities in Portfolio Optimization

Article Quant Q&A · Author: Calum

Summary

The document clarifies how group constraints differ from general linear inequality constraints in portfolio optimization. Both can express limits on a weighted sum of asset positions. A group constraint is a specialized case in which every included asset has an implicit coefficient of one, such as limiting the combined weight of a selected subset. A linear inequality can use arbitrary coefficients, which supports more general portfolio rules.

The example compares two MATLAB portfolio specifications that impose upper bounds on the same three-asset sum, though with different limits. The answer explains that group constraints receive specialized internal handling, including techniques associated with generalized and variable upper bounds, which can reduce storage and improve efficiency when many such constraints are used. For small or ordinary problems, a general linear inequality can express the same rule; choosing between them depends on whether the constraint is an unweighted group sum and whether implementation efficiency matters.

Key ideas

  • A group constraint applies an implicit coefficient of one to each asset in the group.
  • A linear inequality allows arbitrary coefficients across assets.
  • A group constraint can be represented as a special case of a linear inequality.
  • Optimization software may process group constraints more efficiently when there are many of them.
  • Use a general linear inequality when the portfolio rule needs nonuniform coefficients.

Tags

Full text
# What is the difference between group and inequality constraints in Matlab?


# What is the difference between group and inequality constraints in Matlab?












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?

## Answer by nbbo2 (score 1)

https://quant.stackexchange.com/a/24576

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.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.