Main Content

setDefaultConstraints

使用总和为 1 的非负权重设置投资组合约束

说明

示例

obj = setDefaultConstraints(obj)PortfolioPortfolioCVaRPortfolioMAD 对象设置非负权重总和需为 1 的投资组合约束。有关使用这些不同对象时各自工作流的详细信息,请参阅 Portfolio 对象工作流PortfolioCVaR 对象工作流PortfolioMAD Object Workflow

示例

obj = setDefaultConstraints(obj,NumAssets) 设置非负权重总和需为 1 的投资组合约束,并另外提供了一个选项 NumAssets

“默认”投资组合集具有 LowerBound = 0LowerBudget = UpperBudget = 1,使得投资组合 Port 必须满足 sum(Port) = 1Port >= 0

示例

全部折叠

假设您有 20 种资产,您可以定义“默认”投资组合集。

p = Portfolio('NumAssets', 20);
p = setDefaultConstraints(p);
disp(p);
  Portfolio with properties:

          BuyCost: []
         SellCost: []
     RiskFreeRate: []
        AssetMean: []
       AssetCovar: []
    TrackingError: []
     TrackingPort: []
         Turnover: []
      BuyTurnover: []
     SellTurnover: []
             Name: []
        NumAssets: 20
        AssetList: []
         InitPort: []
      AInequality: []
      bInequality: []
        AEquality: []
        bEquality: []
       LowerBound: [20x1 double]
       UpperBound: []
      LowerBudget: 1
      UpperBudget: 1
      GroupMatrix: []
       LowerGroup: []
       UpperGroup: []
           GroupA: []
           GroupB: []
       LowerRatio: []
       UpperRatio: []
     MinNumAssets: []
     MaxNumAssets: []
        BoundType: [20x1 categorical]

假设您有 20 种资产,您可以定义“默认”投资组合集。

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: []
        MinNumAssets: []
        MaxNumAssets: []
           BoundType: [20x1 categorical]

假设您有 20 种资产,您可以定义“默认”投资组合集。

p = PortfolioMAD('NumAssets', 20);
p = setDefaultConstraints(p);
disp(p);
  PortfolioMAD with properties:

         BuyCost: []
        SellCost: []
    RiskFreeRate: []
        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: []
    MinNumAssets: []
    MaxNumAssets: []
       BoundType: [20x1 categorical]

输入参数

全部折叠

投资组合对象,使用 PortfolioPortfolioCVaRPortfolioMAD 对象指定。有关创建 Portfolio 对象的详细信息,请参阅

数据类型: object

投资组合中的资产数量,该参数为标量,可为 PortfolioPortfolioCVaRPortfolioMAD 输入对象 (obj) 指定该参数。

注意

NumAssets 不能用于更改投资组合对象的维度。NumAssets 的默认值是 1

数据类型: double

输出参数

全部折叠

更新的投资组合对象,以 PortfolioPortfolioCVaRPortfolioMAD 对象的形式返回。有关创建 Portfolio 对象的详细信息,请参阅

提示

  • 您还可以使用圆点表示法设置默认的投资组合集。

    obj = obj.setDefaultConstraints(NumAssets);

  • 除了边界和预算约束之外,此函数不会修改投资组合对象中的任何现有约束。如果存在 UpperBound 约束,则会将其清除并设置为 []

版本历史记录

在 R2011a 中推出