Skip to Main Content Skip to Search
Product Documentation

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) to add 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) to add 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:

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

Tips

Input Arguments

obj

A 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.

LowerGroup

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

    Note   If input is scalar, LowerGroup 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

To add another group ratio constraint to ensure that the weight in odd-numbered assets constitute at least 20% of the weight in nonfinancial assets of a portfolio, use addGroupRatio to build up group ratio constraints by creating another group matrix for the second group constraint:

p = Portfolio;
GA = [ true true true false false false ];    % financial companies
GB = [ false false false true true true ];    % non-financial 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 ];    % non-financial 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

Portfolio | setGroupRatio

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS