Syntax

Description

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

AInequality * Port <= bInequality

addInequality "stacks" additional
linear inequality constraints onto any existing linear inequality
constraints that already exist in the input PortfolioMAD object. If
no constraints already exist, this method is the same as setInequality.

Tips

You can also use dot notation to add linear inequality
constraints for portfolio weights to existing constraints.

obj = obj.addInequality(AInequality, bInequality)

You can remove linear inequality constraints for portfolio
weights from a MAD portfolio object using dot notation.

obj = obj.setInequality([ ], [ ])

Input Arguments

obj

MAD portfolio object [PortfolioMAD].

AInequality

Matrix to form linear inequality constraints [matrix].

bInequality

Vector to form linear inequality constraints [vector].

Note:
An error results if AInequality is empty
and bInequality is nonempty, or if AInequality is
nonempty and bInequality is empty.

Output Arguments

obj

Updated MAD portfolio object [PortfolioMAD].

Attributes

Access

public

Static

false

Hidden

false

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

Examples

Set a linear inequality constraint to ensure that the first three assets constitute at most 50% of a portfolio. Then add another linear inequality constraint to ensure that the last three assets constitute at least 50% of a portfolio.