Documentation Center

  • Trial Software
  • Product Updates

addGroupRatio

Class: PortfolioCVaR

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

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

  • 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 CVaR portfolio object, enter empty arrays for the corresponding arrays.

Input Arguments

obj

CVaR portfolio object [PortfolioCVaR].

GroupA

Matrix that forms base groups for comparison [matrix].

GroupB

Matrix that forms comparison groups [matrix].

    Note:   The group matrices GroupA and GroupB often indicate 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.

LowerGroup

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

    Note:   If input is scalar, LowerGroup undergoes scalar expansion to conform 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 conform with the group matrices.

Output Arguments

obj

Updated CVaR portfolio object [PortfolioCVaR].

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 = PortfolioCVaR;
GA = [ true true true false false false ];    % financial companies
GB = [ false false false true true true ];    % nonfinancial companies
p = p.setGroupRatio(GA, GB, [], 0.5);

GA = [ true false true false true false ];    % odd-numbered companies
GB = [ false false false true true true ];    % nonfinancial companies
p = p.addGroupRatio(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

See Also

|

More About

Was this topic helpful?