# Hedging with machine learning

I’ve been thinking about an interesting problem lately: Suppose I have a position in an exotic derivative. How can I automate the hedging process?

Traditionally, one build a pricing model and calculate sensitivities to the risk factors. Then one uses various products like stocks, bonds, futures, swaps etc. to hedge each risk factor. The algorithm would need to determine how to hedge at each discrete time point. I think this has been covered in many papers so far.

I’ve also heard of people using AI to hedge. So suppose we have a preferred share ETF for example. Then the question becomes: given a discrete set of products with their price history, how can one optimally hedge? We need to calculate the weights of the portfolio and minimize the tracking error of the hedging portfolio. This would result in the optimal hedge.

What else could I try? Can someone point me towards some papers in this area? I’ve been thinking about this and might want to pursue the idea for my thesis. Thanks!

## 2 Answers

If you consider hedging a data mining problem you might arguably construct the following scenario:

Given a portfolio of positions, find the parameters $$\beta_i$$ representing the weights of new (hedging) positions from a set of instruments $$\{I_i\}$$, such that the variance of the PnL of the combined portfolio is minimal.

If you considered a rather trivial example, supposed you had a portfolio which had positions in 3 stocks; 2 x Microsoft, 1 x Google and 1 x Apple, and your $$\beta_i$$ determined the weights in hedges from S&P500 companies you might expect that each $$\beta$$ would be zero except for those specific companies whose positions would be -2, -1, -1 respectively.

This was a simple problem but in your case you will unlikely have hedging instruments that provide a direct and perfectly offsetting component. In that case you would be searching for $$\beta$$ which don't produce perfect results but you hope produce as good a result as possible.

Standard machine learning practice would be get some data as a training/learning set, calculate the optimum $$beta$$ values (with some algorithm) and then test the performance of those values on an unseen test dataset. You will expect to get worse performance on the test dataset.

General principles of model design such as complexity in terms of variance/bias will be relevant as will methods to decide on stopping training, in terms of maximising performance on the test (validation set).

I would expect for most standard problems with obvious hedges the process would replicated those hedges, but for not standard problems it may produce some insight into hedging strategies that might otherwise be overlooked.

The optimal hedge is not the one that is minimizing variance of the tracking error of the portfolio in general. You need to properly formulate your utility function and this one has to take into account the trading costs at minimum. In other words your utility function has to incorporate some measure of pnl too.

All of this to say that often when people talk about "optimal hedging" they fail to realize that in reality the hedge itself is an actual strategy on the underlying instruments. So the real question is "what is the best strategy i can execute on my underlying instruments given my position on the derivative product ?".

Now there's no good general answer to "how to use method XYZ to optimize my strategy", it depends on many real life factors that depart from simple market assumptions: returns are not independents, assets trend on certain scales, mean-revert on other, their volatility change with time, their liquidity too etc...