Main Content

checkFeasibility

Check feasibility of input portfolios against portfolio object

Description

example

status = checkFeasibility(obj,pwgt) checks the feasibility of input portfolios against a portfolio object.

Use the checkFeasibility function with a Portfolio, PortfolioCVaR, or PortfolioMAD object to check the feasibility of input portfolios against a portfolio object. For details on the respective workflows when using these different objects, see Portfolio Object Workflow, PortfolioCVaR Object Workflow, and PortfolioMAD Object Workflow.

Examples

collapse all

Given portfolio p, determine if p is feasible.

m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0; 
    0.00408 0.0289 0.0204 0.0119;
    0.00192 0.0204 0.0576 0.0336;
    0 0.0119 0.0336 0.1225 ];

p = Portfolio;
p = setAssetMoments(p, m, C);
p = setDefaultConstraints(p);
pwgt = estimateFrontier(p);

checkFeasibility(p, pwgt)
ans = 1x10 logical array

   1   1   1   1   1   1   1   1   1   1

Given portfolio p, determine if p is feasible.

m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0; 
    0.00408 0.0289 0.0204 0.0119;
    0.00192 0.0204 0.0576 0.0336;
    0 0.0119 0.0336 0.1225 ];
m = m/12;
C = C/12;

AssetScenarios = mvnrnd(m, C, 20000);

p = PortfolioCVaR;
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);
p = setProbabilityLevel(p, 0.95);

pwgt = estimateFrontier(p);

checkFeasibility(p, pwgt)
ans = 1x10 logical array

   1   1   1   1   1   1   1   1   1   1

Given portfolio p, determine if p is feasible.

m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0; 
    0.00408 0.0289 0.0204 0.0119;
    0.00192 0.0204 0.0576 0.0336;
    0 0.0119 0.0336 0.1225 ];
m = m/12;
C = C/12;

AssetScenarios = mvnrnd(m, C, 20000);

p = PortfolioMAD;
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);

pwgt = estimateFrontier(p);

checkFeasibility(p, pwgt)
ans = 1x10 logical array

   1   1   1   1   1   1   1   1   1   1

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

Portfolios to check, specified as a NumAssets-by-NumPorts matrix.

Data Types: double

Output Arguments

collapse all

Indicator if portfolio is feasible, returned as a row vector of NumPorts indicators that are true if portfolio is feasible and false otherwise.

Note

By definition, any portfolio set must be nonempty and bounded. If the set is empty, no portfolios can be feasible. Use estimateBounds to test for nonempty and bounded sets.

Feasibility status is returned for Portfolio, PortfolioCVaR, or PortfolioMAD objects. For more information on creating a portfolio object, see

Tips

  • You can also use dot notation to check the feasibility of input portfolios against a portfolio object.

    status = obj.checkFeasibility(pwgt);

  • The constraint tolerance to assess whether a constraint is satisfied is obtained from the hidden property obj.defaultTolCon.

Version History

Introduced in R2011a