Financial Derivatives Toolbox    

Hedging with hedgeopt

To illustrate the hedging functions, consider the delta, gamma, and vega sensitivity measures. In the context of the Financial Derivatives Toolbox, delta is the price sensitivity measure of shifts in the forward yield curve, gamma is the delta sensitivity measure of shifts in the forward yield curve, and vega is the price sensitivity measure of shifts in the volatility process. Note that the delta, gamma, and vega sensitivities calculated by the toolbox are dollar sensitivities. (See Calculating Prices and Sensitivities (HJM) and Calculating Prices and Sensitivities (BDT) for details.)

To illustrate the hedging facility, consider the portfolio HJMInstSet obtained from the example file deriv.mat. The portfolio consists of eight instruments: two bonds, one bond option, one fixed rate note, one floating rate note, one cap, one floor, and one swap.

Both hedging functions require some common inputs, including the current portfolio holdings (allocations), and a matrix of instrument sensitivities. To create these inputs, load the example portfolio into memory

compute price and sensitivities

and extract the current portfolio holdings.

For convenience place the delta, gamma, and vega sensitivity measures into a matrix of sensitivities.

Each row of the Sensitivities matrix is associated with a different instrument in the portfolio, and each column with a different sensitivity measure.

To summarize the portfolio information

The first column above is the dollar unit price of each instrument, the second is the holdings of each instrument (the quantity held or the number of contracts), and the third, fourth, and fifth columns are the dollar delta, gamma, and vega sensitivities, respectively.

The current portfolio sensitivities are a weighted average of the instruments in the portfolio.

Maintaining Existing Allocations

To illustrate using hedgeopt, suppose that you want to maintain your existing portfolio. The first form of hedgeopt minimizes the cost of hedging a portfolio given a set of target sensitivities. If you want to maintain your existing portfolio composition and exposure, you should be able to do so without spending any money. To verify this, set the target sensitivities to the current sensitivities.

Our portfolio composition and sensitivities are unchanged, and the cost associated with doing nothing is zero. The cost is defined as the change in portfolio value. This number cannot be less than zero because the rebalancing cost is defined as a nonnegative number.

If Value0 and Value1 represent the portfolio value before and after rebalancing, respectively, the zero cost can also be verified by comparing the portfolio values.

Partially Hedged Portfolio

Building upon the previous example, suppose you want to know the cost to achieve an overall portfolio dollar sensitivity of [-23000 -3300 3000], while allowing trading only in instruments 2, 3, and 6 (holding the positions of instruments 1, 4, 5, 7, and 8 fixed.) To find the cost, first set the target portfolio dollar sensitivity.

Then, specify the instruments to be fixed.

Finally, call hedgeopt

and again examine the results.

Recompute Value1, the portfolio value after rebalancing.

As expected, the cost, $19174.02, is the difference between Value0 and Value1, $23674.62 - $4500.60. Only the positions in instruments 2, 3, and 6 have been changed.

Fully Hedged Portfolio

The above example illustrates a partial hedge, but perhaps the most interesting case involves the cost associated with a fully-hedged portfolio (simultaneous delta, gamma, and vega neutrality). In this case, set the target sensitivity to a row vector of zeros and call hedgeopt again.

Examining the outputs reveals that you have obtained a fully-hedged portfolio

but at an expense of over $20,000,

The positions needed to achieve a fully-hedged portfolio

result in the new portfolio value

Minimizing Portfolio Sensitivities

The above examples illustrate how to use hedgeopt to determine the minimum cost of hedging a portfolio given a set of target sensitivities. In these examples, portfolio target sensitivities are treated as equality constraints during the optimization process. You tell hedgeopt what sensitivities you want, and it tells you what it will cost to get those sensitivities.

A related problem involves minimizing portfolio sensitivities for a given set of maximum target costs. For this goal the target costs are treated as inequality constraints during the optimization process. You tell hedgeopt the most you are willing spend to insulate your portfolio, and it tells you the smallest portfolio sensitivities you can get for your money.

To illustrate this use of hedgeopt, compute the portfolio dollar sensitivities along the entire cost frontier. From the previous examples, you know that spending nothing simply replicates the existing portfolio, while spending $23,055.90 completely hedges the portfolio.

Assume, for example, you are willing to spend as much as $50,000, and want to see what portfolio sensitivities will result along the cost frontier. Assume the same instruments are held fixed, and that the cost frontier is evaluated from $0 to $50,000 at increments of $1000.

Now, call hedgeopt.

With this data, you can plot the required hedging cost versus the funds available (the amount you are willing to spend).

Figure 3-1: Rebalancing Cost Profile

and the portfolio dollar sensitivities versus the funds available

Figure 3-2: Funds Available for Rebalancing


  Hedging Portfolios Self-Financing Hedges (hedgeslf)