setMinMaxNumAssets
Set cardinality constraints on the number of assets invested in a portfolio
Since R2018b
Description
sets cardinality constraints for a obj
= setMinMaxNumAssets(obj
,MinNumAssets
,MaxNumAssets
)Portfolio
,
PortfolioCVaR
, or PortfolioMAD
object.
MinNumAssets
and MaxNumAssets
are the
minimum and maximum number of assets invested in the portfolio, respectively.
The total number of allocated assets satisfying the Bound constraints is between
[MinNumAssets
, MaxNumAssets
]. For
details on the respective workflows when using these different objects, see
Portfolio Object Workflow, PortfolioCVaR Object Workflow,
and PortfolioMAD Object Workflow.
Examples
Input Arguments
Output Arguments
Tips
You can also use dot notation to set up a list of identifiers for assets.
obj = obj.setMinMaxNumAssets(MinNumAssets,MaxNumAssets);
Specifying empty values ([
[]
) forMinNumAssets
andMaxNumAsssets
removes limit constraints from thePortfolio
,PortfolioCVaR
, orPortfolioMAD
object.
Version History
Introduced in R2018b
See Also
setBounds
| setSolverMINLP
| estimateAssetMoments
| estimateFrontier
| estimateFrontierByReturn
| estimateFrontierByRisk
| estimateFrontierLimits
| estimateMaxSharpeRatio
| estimatePortSharpeRatio
| estimatePortMoments
| estimatePortReturn
| estimatePortRisk
Topics
- Working with 'Conditional' BoundType, MinNumAssets, and MaxNumAssets Constraints Using Portfolio Objects
- Working with 'Conditional' BoundType, MinNumAssets, and MaxNumAssets Constraints Using PortfolioCVaR Objects
- Working with 'Conditional' BoundType, MinNumAssets, and MaxNumAssets Constraints Using PortfolioMAD Objects
- Troubleshooting for Setting 'Conditional' BoundType, MinNumAssets, and MaxNumAssets Constraints
- Common Operations on the Portfolio Object
- Portfolio Optimization Examples Using Financial Toolbox™
- Portfolio Optimization with Semicontinuous and Cardinality Constraints
- Mixed-Integer Quadratic Programming Portfolio Optimization: Problem-Based
- Role of Convexity in Portfolio Problems
- Portfolio Set for Optimization Using Portfolio Objects
- Portfolio Set for Optimization Using PortfolioCVaR Object
- Portfolio Set for Optimization Using PortfolioMAD Object