Working with'Simple'
Bound Constraints Using Portfolio Object
'Simple'
bound constraints are optional linear constraints that maintain upper and lower bounds on portfolio weights (see'Simple' Bound Constraints). Although every portfolio set must be bounded, it is not necessary to specify a portfolio set with explicit bound constraints. For example, you can create a portfolio set with an implicit upper bound constraint or a portfolio set with average turnover constraints. The bound constraints have propertiesLowerBound
for the lower-bound constraint andUpperBound
for the upper-bound constraint. Set default values for these constraints using thesetDefaultConstraints
function (seeSetting Default Constraints for Portfolio Weights Using Portfolio Object).
Setting'Simple'
Bounds Using thePortfolio
Function
The properties for bound constraints are set through thePortfolio
object. Suppose that you have a balanced fund with stocks that can range from 50% to 75% of your portfolio and bonds that can range from 25% to 50% of your portfolio. The bound constraints for a balanced fund are set with:
lb = [ 0.5; 0.25 ]; ub = [ 0.75; 0.5 ]; p = Portfolio('LowerBound', lb,'UpperBound', ub,'BoundType','Simple'); disp(p.NumAssets) disp(p.LowerBound) disp(p.UpperBound)
2 0.5000 0.2500 0.7500 0.5000
To continue with this example, you must set up a budget constraint. For details, seeWorking with Budget Constraints Using Portfolio Object.
Setting'Simple'
Bounds Using thesetBounds
Function
You can also set the properties for bound constraints usingsetBounds
. Suppose that you have a balanced fund with stocks that can range from 50% to 75% of your portfolio and bonds that can range from 25% to 50% of your portfolio. Given aPortfolio
objectp
, usesetBounds
to set the bound constraints:
lb = [ 0.5; 0.25 ]; ub = [ 0.75; 0.5 ]; p = Portfolio; p = setBounds(p, lb, ub,'BoundType','Simple'); disp(p.NumAssets) disp(p.LowerBound) disp(p.UpperBound)
2 0.5000 0.2500 0.7500 0.5000
Setting'Simple'
Bounds Using thePortfolio
Function orsetBounds
Function
Both thePortfolio
对象和setBounds
函数实现标量eithe扩张r theLowerBound
orUpperBound
properties. If theNumAssets
property is already set in thePortfolio
object, scalar arguments for either property expand to have the same value across all dimensions. In addition,setBounds
lets you specifyNumAssets
as an optional argument. Suppose that you have a universe of 500 assets and you want to set common bound constraints on all assets in your universe. Specifically, you are a long-only investor and want to hold no more than 5% of your portfolio in any single asset. You can set these bound constraints in any of these equivalent ways:
p = Portfolio('NumAssets', 500,'LowerBound', 0,'UpperBound', 0.05,'BoundType','Simple');
or
p = Portfolio('NumAssets', 500); p = setBounds(p, 0, 0.05,'BoundType','Simple');
or
p = Portfolio; p = setBounds(p, 0, 0.05,'NumAssets', 500,'BoundType','Simple');
To clear bound constraints from yourPortfolio
object, use either thePortfolio
object orsetBounds
with empty inputs for the properties to be cleared. For example, to clear the upper-bound constraint from thePortfolio
objectp
in the previous example:
p = Portfolio(p,'UpperBound', []);
See Also
Portfolio
|setDefaultConstraints
|setBounds
|setBudget
|setGroups
|setGroupRatio
|setEquality
|setInequality
|setTurnover
|setOneWayTurnover
|setTrackingPort
|setTrackingError
Related Examples
- Creating the Portfolio Object
- Working with 'Conditional' BoundType, MinNumAssets, and MaxNumAssets Constraints Using Portfolio Objects
- Working with Portfolio Constraints Using Defaults
- Validate the Portfolio Problem for Portfolio Object
- Estimate Efficient Portfolios for Entire Efficient Frontier for Portfolio Object
- Estimate Efficient Frontiers for Portfolio Object
- Constraint Specification Using a Portfolio Object
- Asset Allocation Case Study
- Portfolio Optimization Examples
- Portfolio Optimization with Semicontinuous and Cardinality Constraints
- Black-Litterman Portfolio Optimization
- Portfolio Optimization Using Factor Models
- 投资组合优化使用Social Performance Measure
- Diversification of Portfolios
More About
- Portfolio Object
- Portfolio Optimization Theory
- Portfolio Object Workflow
- Setting Up a Tracking Portfolio