obj = setBudget(obj,LowerBudget)
obj = setBudget(obj,LowerBudget,UpperBudget)
obj = setBudget(obj,LowerBudget) sets up the lower budget constraint.
obj = setBudget(obj,LowerBudget,UpperBudget) sets up budget constraints with an additional option for UpperBudget.
You can also use dot notation to set up the budget constraints.
obj = obj.setBudget(LowerBudget, UpperBudget);
Portfolio object [Portfolio].
Lower-bound for budget constraint [scalar].
(Optional) Upper-bound for budget constraint [scalar].
Note: Given bounds for a budget constraints in either LowerBudget or UpperBudget, budget constraints require any portfolio in Port to satisfy:
LowerBudget <= sum(Port) <= UpperBudget
One or both constraints may be specified. The usual budget constraint for a fully-invested portfolio is to have LowerBudget = UpperBudget = 1. However, if the portfolio has allocations in cash, the budget constraints can be used to specify the cash constraints. For example, if the portfolio can hold between 0% and 10% in cash, the budget constraint would be set up with
obj = setBudget(obj, 0.9, 1)
To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.
Assume you have a fund that permits up to 10% leverage, which means that your portfolio can be from 100% to 110% invested in risky assets. Given a Portfolio object p, set the budget constraint.
p = Portfolio; p = setBudget(p, 1, 1.1); disp(p.LowerBudget); disp(p.UpperBudget);