Documentation Center

  • Trial Software
  • Product Updates

getGroupRatio

Class: PortfolioMAD

Obtain group ratio constraint arrays from PortfolioMAD object

Syntax

[GroupA,GroupB,LowerRatio,UpperRatio] = getGroupRatio(obj)

Description

[GroupA,GroupB,LowerRatio,UpperRatio] = getGroupRatio(obj) obtains the group ratio constraint arrays from a MAD portfolio object.

Tips

Use dot notation to obtain group ratio constraint arrays from the MAD portfolio object.

[GroupA, GroupB, LowerRatio, UpperRatio] = obj.getGroupRatio;

Input Arguments

obj

MAD portfolio object [PortfolioMAD].

Output Arguments

GroupA

Matrix that forms base groups for comparison [matrix].

GroupB

Matrix that forms comparison groups [matrix].

LowerRatio

Lower bound for ratio of GroupB groups to GroupA groups [vector].

UpperRatio

Upper bound for ratio of GroupB groups to GroupA groups [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 Ratio Constraints

Suppose you want to ensure that the ratio of financial to nonfinancial companies in your portfolios never exceeds 50%. Assume you have six assets with three financial companies (assets 1-3) and three nonfinancial companies (assets 4-6). After setting group ratio constraints, obtain the values for GroupA, GroupB, LowerRatio, and UpperRatio.

GA = [ true true true false false false ];   % financial companies
GB = [ false false false true true true ];   % nonfinancial companies
p = PortfolioMAD;
p = p.setGroupRatio(GA, GB, [], 0.5);
[GroupA, GroupB, LowerRatio, UpperRatio] = p.getGroupRatio
GroupA =

     1     1     1     0     0     0


GroupB =

     0     0     0     1     1     1


LowerRatio =

     []


UpperRatio =

    0.5000

See Also

More About

Was this topic helpful?