Main Content

getBounds

Obtain bounds for portfolio weights from portfolio object

Description

Use thegetBoundsfunction with aPortfolio,PortfolioCVaR, orPortfolioMADobject to obtain bounds for portfolio weights from portfolio objects.

For details on the respective workflows when using these different objects, seePortfolio Object Workflow,PortfolioCVaR Object Workflow, andPortfolioMAD对象工作flow.

example

[LowerBound,UpperBound] = getBounds(obj)obtains bounds for portfolio weights from portfolio objects.

Examples

collapse all

Given portfoliopwith the default constraints set, obtain the values forLowerBoundandUpperBound.

p = Portfolio; p = setDefaultConstraints(p, 5); [LowerBound, UpperBound] = getBounds(p)
LowerBound =5×10 0 0 0 0
UpperBound = []

Given a PortfolioCVaR objectpwith the default constraints set, obtain the values forLowerBoundandUpperBound.

p = PortfolioCVaR; p = setDefaultConstraints(p, 5); [LowerBound, UpperBound] = getBounds(p)
LowerBound =5×10 0 0 0 0
UpperBound = []

Given a PortfolioMAD objectpwith the default constraints set, obtain the values forLowerBoundandUpperBound.

p = PortfolioMAD; p = setDefaultConstraints(p, 5); [LowerBound, UpperBound] = getBounds(p)
LowerBound =5×10 0 0 0 0
UpperBound = []

Input Arguments

collapse all

Object for portfolio, specified usingPortfolio,PortfolioCVaR, orPortfolioMADobject. For more information on creating a portfolio object, see

Data Types:object

Output Arguments

collapse all

Lower-bound weight for each asset, returned as a vector for aPortfolio,PortfolioCVaR, orPortfolioMADinput object (obj). For more information on creating a portfolio object, see

Upper-bound weight for each asset, returned as a vector for aPortfolio,PortfolioCVaR, orPortfolioMADinput object (obj). For more information on creating a portfolio object, see

Tips

You can also use dot notation to obtain bounds for portfolio weights from portfolio objects.

[LowerBound, UpperBound] = obj.getBounds;

Version History

Introduced in R2011a