addGroupRatio

Class: Portfolio

Add group ratio constraints for portfolio weights to existing group ratio constraints

Syntax

obj = addGroupRatio(obj,GroupA,GroupB,LowerRatio)
obj = addGroupRatio(obj,GroupA,GroupB,LowerRatio,
UpperRatio)

Description

obj = addGroupRatio(obj,GroupA,GroupB,LowerRatio) adds group ratio constraints for the portfolio weights to existing group ratio constraints with just a lower bound on the ratio between groups.

obj = addGroupRatio(obj,GroupA,GroupB,LowerRatio,
UpperRatio)
adds group ratio constraints for the portfolio weights to existing group ratio constraints with an additional option for UpperRatio.

Given base and comparison group matrices GroupA and GroupB and, either LowerRatio, or UpperRatio bounds, group ratio constraints require any portfolio in Port to satisfy the following:

(GroupB * Port) .* LowerRatio <= GroupA * Port <= (GroupB * Port) .* UpperRatio

    Caution   This collection of constraints usually requires that portfolio weights be nonnegative and that the products GroupA * Port and GroupB * Port are always nonnegative. Although negative portfolio weights and non-Boolean group ratio matrices are supported, use with caution.

Tips

  • You can also use dot notation to add group ratio constraints for the portfolio weights to existing group ratio constraints.

    obj = obj.addGroupRatio(GroupA, GroupB, LowerRatio, UpperRatio)
  • To remove group ratio constraints from a Portfolio object using dot notation, enter empty arrays for the corresponding arrays.

Input Arguments

obj

Portfolio object [Portfolio].

GroupA

Matrix that forms base groups for comparison [matrix].

GroupB

Matrix that forms comparison groups [matrix].

    Note:   The group matrices GroupA and GroupB are usually indicators of membership in groups, which means that their elements are usually either 0 or 1. Because of this interpretation, the GroupA and GroupB matrices can be logical or numerical arrays.

LowerRatio

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

    Note:   If input is scalar, LowerRatio undergoes scalar expansion to be conformable with the group matrices.

UpperRatio

(Optional) Upper-bound for ratio of GroupB groups to GroupA groups [vector].

    Note:   If input is scalar, UpperRatio undergoes scalar expansion to be conformable with the group matrices.

Output Arguments

obj

Updated Portfolio object [Portfolio].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

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

Examples

expand all

Add Group Ratio Constraints

Set a group ratio constraint to ensure that the weight in financial assets does not exceed 50% of the weight in nonfinancial assets. Then add another group ratio constraint to ensure that the weight in financial assets constitute at least 20% of the weight in nonfinancial assets of the portfolio.

p = Portfolio;
GA = [ true true true false false false ];    % financial companies
GB = [ false false false true true true ];    % nonfinancial companies
p = setGroupRatio(p, GA, GB, [], 0.5);

GA = [ true false true false true false ];    % odd-numbered companies
GB = [ false false false true true true ];    % nonfinancial companies
p = addGroupRatio(p, GA, GB, 0.2);

disp(p.NumAssets);
disp(p.GroupA);
disp(p.GroupB);
disp(p.LowerRatio);
disp(p.UpperRatio);
     6

     1     1     1     0     0     0
     1     0     1     0     1     0

     0     0     0     1     1     1
     0     0     0     1     1     1

      -Inf
    0.2000

    0.5000
       Inf

Was this topic helpful?