Set up portfolio constraints with nonnegative weights that sum to 1 for PortfolioCVaR object
obj = setDefaultConstraints(obj)
obj = setDefaultConstraints(obj,NumAssets)
obj = setDefaultConstraints(obj) sets up portfolio constraints with nonnegative weights that must sum to 1.
obj = setDefaultConstraints(obj,NumAssets) sets up portfolio constraints with nonnegative weights that must sum to 1 with an additional option for NumAssets.
A "default" portfolio set has LowerBound = 0 and LowerBudget = UpperBudget = 1 such that a portfolio Port must satisfy sum(Port) = 1 with Port >= 0 .
You can also use dot notation to set up the default portfolio set.
obj = obj.setDefaultConstraints(NumAssets);
This method does not modify any existing constraints in a PortfolioCVaR object other than the bound and budget constraints. If an UpperBound constraint exists, it is cleared and set to .
CVaR portfolio object [PortfolioCVaR].
(Optional) Number of assets in a portfolio [scalar]. NumAssets cannot be used to change the dimension of a PortfolioCVaR object.
To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.
Assuming you have 20 assets, you can define the "default" portfolio set.
p = PortfolioCVaR('NumAssets', 20); p = setDefaultConstraints(p); disp(p);
PortfolioCVaR with properties: BuyCost:  SellCost:  RiskFreeRate:  ProbabilityLevel:  Turnover:  BuyTurnover:  SellTurnover:  NumScenarios:  Name:  NumAssets: 20 AssetList:  InitPort:  AInequality:  bInequality:  AEquality:  bEquality:  LowerBound: [20x1 double] UpperBound:  LowerBudget: 1 UpperBudget: 1 GroupMatrix:  LowerGroup:  UpperGroup:  GroupA:  GroupB:  LowerRatio:  UpperRatio: