obj = setGroupRatio(obj,GroupA)
obj = setGroupRatio(obj,GroupA,GroupB,LowerRatio,UpperRatio)
obj = setGroupRatio(obj,GroupA) sets up the group ratio constraints for portfolio weights with lower bound on the ratio between groups.
obj = setGroupRatio(obj,GroupA,GroupB,LowerRatio,
UpperRatio) to set up group ratio constraints for portfolio weights with an additional option specified for UpperRatio.
Given base and comparison group matrices GroupA and GroupB and LowerRatio or UpperRatio bounds, group ratio constraints require any portfolio in Port to satisfy the following:
(GroupB * Port) .* LowerRatio <= GroupA * Port <= (GroupB * Port) .* UpperRatio
Use dot notation to set up group ratio constraints for portfolio weight.
obj = obj.setGroupRatio(GroupA, GroupB, LowerRatio, UpperRatio);
To remove group ratio constraints, enter empty arrays for the corresponding arrays. To add to existing group ratio constraints, use addGroupRatio.
Portfolio object [Portfolio].
Matrix that forms base groups for comparison [matrix].
Matrix that forms comparison groups [matrix].
Lower bound for ratio of GroupB groups to GroupA groups [vector].
(Optional) Upper bound for ratio of GroupB groups to GroupA groups [vector].
To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.
Suppose you want to ensure that the ratio of financial to nonfinancial companies in your portfolio never exceeds 50%. Assume you have six assets with three financial companies (assets 1-3) and three nonfinanical companies (assets 4-6). Group ratio constraints can be set with:
GA = [ true true true false false false ]; % financial companies GB = [ false false false true true true ]; % nonfinancial companies p = Portfolio; p = p.setGroupRatio(GA, GB, , 0.5); disp(p.NumAssets); disp(p.GroupA); disp(p.GroupB); disp(p.UpperRatio);
6 1 1 1 0 0 0 0 0 0 1 1 1 0.5000