Documentation Center

  • Trial Software
  • Product Updates

setDefaultConstraints

Class: PortfolioCVaR

Set up portfolio constraints with nonnegative weights that sum to 1 for PortfolioCVaR object

Syntax

obj = setDefaultConstraints(obj)
obj = setDefaultConstraints(obj,NumAssets)

Description

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 .

Tips

  • 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 [].

Input Arguments

obj

CVaR portfolio object [PortfolioCVaR].

NumAssets

(Optional) Number of assets in a portfolio [scalar]. NumAssets cannot be used to change the dimension of a PortfolioCVaR object.

Default: 1

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

Define Default Constraints for the PortfolioCVaR Object

Assuming you have 20 assets, you can define the "default" portfolio set.

p = PortfolioCVaR('NumAssets', 20);
p = p.setDefaultConstraints;
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: []

See Also

| | |

More About

Was this topic helpful?