Skip to Main Content Skip to Search
Product Documentation

addInequality - Class: Portfolio

Add linear inequality constraints for portfolio weights to existing constraints

Syntax

obj = addInequality(obj, AInequality, bInequality)

Description

obj = addInequality(obj, AInequality, bInequality) to add linear inequality constraints for portfolio weights to existing constraints.

Given linear inequality constraint matrix AInequality and vector bInequality, every weight in a portfolio Port must satisfy:

AInequality * Port <= bInequality

Tips

Input Arguments

obj

A portfolio object [Portfolio].

AEquality

Matrix to form linear inequality constraints [matrix].

bEquality

Vector to form linear inequality constraints [vector].

Output Arguments

obj

Updated portfolio object [Portfolio].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

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

Examples

To add another linear inequality constraint to ensure that the last three assets constitute at least 50% of a portfolio, use addInequality to build up linear inequality constraints by creating another system of inequalities:

p = Portfolio;
A = [ 1 1 1 0 0 ];    % first inequality constraint
b = 0.5;
p = p.setInequality(A, b);

A = [ 0 0 -1 -1 -1 ];    % second inequality constraint
b = -0.5;
p = p.addInequality(A, b);

disp(p.NumAssets);
disp(p.AInequality);
disp(p.bInequality);

5

1     1     1     0     0
0     0    -1    -1    -1

0.5000
-0.5000

See Also

Portfolio | setInequality

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS