Financial Derivatives Toolbox    

Specifying Constraints with ConSet

Both hedgeopt and hedgeslf accept an optional input argument, ConSet, that allows you to specify a set of linear inequality constraints for instruments in your portfolio. The examples in this section are quite brief. For additional information regarding portfolio constraint specifications, refer to the section Analyzing Portfolios found in the Financial Toolbox User's Guide.

For the first example of setting constraints, return to the fully-hedged portfolio example that used hedgeopt to determine the minimum cost of obtaining simultaneous delta, gamma, and vega neutrality (target sensitivities all zero). Recall that when hedgeopt computes the cost of rebalancing a portfolio, the input target sensitivities you specify are treated as equality constraints during the optimization process. The situation is reproduced below for convenience.

The outputs provide a fully-hedged portfolio

at an expense of over $30,000.

The positions needed to achieve this fully-hedged portfolio are

Suppose now that you want to place some upper and lower bounds on the individual instruments in your portfolio. You can specify these constraints, along with a variety of general linear inequality constraints, with the Financial Toolbox function portcons.

As an example, assume that, in addition to holding instruments 1, 4, 5, 7, and 8 fixed as before, you want to bound the position of all instruments to within +/- 200 contracts (for each instrument, you cannot short or long more than 200 contracts). Applying these constraints disallows the current position in the second instrument (short 227.78). All other instruments are currently within the upper/lower bounds.

You can generate these constraints by first specifying the lower and upper bounds vectors and then calling portcons.

To impose these constraints, call hedgeopt with ConSet as the last input.

Examine the outputs and see that they are all set to NaN, indicating that the problem, given the constraints, is not solvable. Intuitively, the results mean that you cannot obtain simultaneous delta, gamma, and vega neutrality with these constraints at any price.

To see how close you can get to portfolio neutrality with these constraints, call hedgeslf.

hedgeslf enforces the lower bound for the second instrument, but the sensitivity is far from neutral. The cost to obtain this portfolio is

As a final example of user-specified constraints, rebalance the portfolio using the second hedging goal of hedgeopt. Assume that you are willing to spend as much as $20,000 to rebalance your portfolio, and you want to know what minimum portfolio sensitivities you can get for your money. In this form, recall that the target cost ($20,000) is treated as an inequality constraint during the optimization process.

For reference, invoke hedgeopt without any user-specified linear inequality constraints.

This result corresponds to the $20,000 point along the Portfolio Sensitivities Profile shown in Figure 1-3, Rebalancing Cost,.

Assume that, in addition to holding instruments 1, 4, 5, 7, and 8 fixed as before, you wish to bound the position of all instruments to within +/- 120 contracts (for each instrument, you cannot short more than 120 contracts and you cannot long more than 120 contracts). These bounds disallow the current position in the second instrument (-129.80). All other instruments are currently within the upper/lower bounds.

As before, you can generate these constraints by first specifying the lower and upper bounds vectors and then calling portcons.

To impose these constraints, again call hedgeopt with ConSet as the last input.

With these constraints hedgeopt enforces the lower bound for the second instrument. The cost incurred is $19,097.25.


 Self Financing Hedges (hedgeslf) Hedging with Constrained Portfolios