| Contents | Index |
Add group constraints for portfolio weights to existing group constraints
obj = addGroups(obj, GroupMatrix, LowerGroup)
obj = addGroups(obj, GroupMatrix, LowerGroup, UpperGroup)
obj = addGroups(obj, GroupMatrix, LowerGroup) to add group constraints for portfolio weights to existing group constraints subject to a lower bound on groups.
obj = addGroups(obj, GroupMatrix, LowerGroup, UpperGroup) to add the group constraints for portfolio weights to existing group constraints with an additional option for UpperGroup.
Given GroupMatrix and either LowerGroup or UpperGroup, a portfolio Port must satisfy:
LowerGroup <= GroupMatrix * Port <= UpperGroup
Use dot notation to add group constraints for portfolio weights:
obj = obj.addGroups(GroupMatrix, LowerGroup, UpperGroup)
To remove group constraints from a portfolio object, enter empty arrays for the corresponding arrays.
obj |
Updated portfolio object [Portfolio]. |
| Access | public |
| Static | false |
| Hidden | false |
To learn about attributes of methods, see Method Attributes in the MATLAB Object-Oriented Programming documentation.
To add another group constraint to ensure that the odd-numbered assets constitute at least 20% of a portfolio, use addGroups to build up group constraints by creating another group matrix for a second group constraint:
p = Portfolio; G = [ true true true false false ]; % group matrix for first group constraint p = p.setGroups(G, [], 0.3); G = [ true false true false true ]; % group matrix for second group constraint p = p.addGroups(G, 0.2); disp(p.NumAssets); disp(p.GroupMatrix); disp(p.LowerGroup); disp(p.UpperGroup); 5 1 1 1 0 0 1 0 1 0 1 -Inf 0.2000 0.3000 Inf
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 |