getBounds

Obtain bounds for portfolio weights from portfolio object

Use the getBounds function with a Portfolio, PortfolioCVaR, or PortfolioMAD object to obtain bounds for portfolio weights from portfolio objects.

For details on the respective workflows when using these different objects, see Portfolio Object Workflow, PortfolioCVaR Object Workflow, and PortfolioMAD Object Workflow.

Syntax

[LowerBound,UpperBound] = getBounds(obj)

Description

example

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

Examples

collapse all

Given portfolio p with the default constraints set, obtain the values for LowerBound and UpperBound.

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

     0
     0
     0
     0
     0

UpperBound =

     []

Given a PortfolioCVaR object p with the default constraints set, obtain the values for LowerBound and UpperBound.

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

     0
     0
     0
     0
     0

UpperBound =

     []

Given a PortfolioMAD object p with the default constraints set, obtain the values for LowerBound and UpperBound.

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

     0
     0
     0
     0
     0

UpperBound =

     []

Input Arguments

collapse all

Object for portfolio, specified using Portfolio, PortfolioCVaR, or PortfolioMAD object. 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 a Portfolio, PortfolioCVaR, or PortfolioMAD input object (obj). For more information on creating a portfolio object, see

Upper-bound weight for each asset, returned as a vector for a Portfolio, PortfolioCVaR, or PortfolioMAD input 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;

Introduced in R2011a