checkFeasibility

Class: Portfolio

Check feasibility of input portfolios against Portfolio object

Syntax

status = checkFeasibility(obj,pwgt)

Description

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

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.

Input Arguments

obj

Portfolio object [Portfolio].

pwgt

Portfolios to be checked [NumAssets-by-NumPorts matrix].

Output Arguments

status

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.

Attributes

Accesspublic
Staticfalse
Hiddenfalse

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

Examples

expand all

Determine if the Portfolio Is Feasible

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 =

     1     1     1     1     1     1     1     1     1     1

Was this topic helpful?