Add linear equality constraints for portfolio weights to existing constraints
adds linear equality constraints for portfolio weights to existing constraints
for obj
= addEquality(obj
,AEquality
,bEquality
)Portfolio
, PortfolioCVaR
, or
PortfolioMAD
objects. For details on the respective
workflows when using these different objects, see Portfolio Object Workflow, PortfolioCVaR Object Workflow,
and PortfolioMAD Object Workflow.
Given a linear equality constraint matrix AEquality
and
vector bEquality
, every weight in a portfolio
Port
must satisfy the
following:
AEquality * Port = bEquality
This function "stacks" additional linear equality constraints onto any
existing linear equality constraints that exist in the input portfolio object.
If no constraints exist, this method is the same as setEquality
.
You can also use dot notation to add the linear equality constraints for portfolio weights.
obj = obj.addEquality(AEquality, bEquality)
You can also remove linear equality constraints from a portfolio object using dot notation.
obj = obj.setEquality([ ], [ ])