Quantcast

Documentation Center

  • Trial Software
  • Product Updates

getGroups

Class: Portfolio

Obtain group constraint arrays from Portfolio object

Syntax

[GroupMatrix,LowerGroup,UpperGroup] = getGroups(obj)

Description

[GroupMatrix,LowerGroup,UpperGroup] = getGroups(obj) obtains the group constraint arrays from a Portfolio object.

Tips

Use dot notation to obtain the group constraint arrays from the Portfolio object.

[GroupMatrix, LowerGroup, UpperGroup] = obj.getGroups;

Input Arguments

obj

Portfolio object [Portfolio].

Output Arguments

GroupMatrix

Group constraint matrix [matrix].

LowerGroup

Lower bound for group constraints [vector].

UpperGroup

Upper bound for group constraints [vector].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

Examples

expand all

Obtain Group Constraints

Suppose you have a portfolio of five assets and you want to ensure that the first three assets constitute no more than 30% of your portfolio. Given a Portfolio object p with the group constraints set, obtain the values for GroupMatrix, LowerGroup, and UpperGroup.

G = [ true true true false false ];
p = Portfolio;
p = p.setGroups(G, [], 0.3);
[GroupMatrix, LowerGroup, UpperGroup] = p.getGroups
GroupMatrix =

     1     1     1     0     0


LowerGroup =

     []


UpperGroup =

    0.3000

See Also

More About

Was this topic helpful?