# How to numerically obtain delta?

The delta in option pricing, also called the hedge ratio, is expressed as the sensitivity of the option price to the underlying price change.

The analytical solution for the most common option pricing models, such as the Black-Scholes, Corrado and Su, and other frameworks can be found on the internet or in books.

However, I am dealing with a more complex model for which the analytical solution is not that obvious, and hence therefore want to obtain the delta (and later also the other greeks) by means of a numerical method.

So far I haven't found a proper way to do so. More specific, when simply calculating the gradient of the Call price with respect to the underlying Spot price, I get different values than from the analytical solution -- In case of the Black-Scholes model.

Can someone explain why the gradient does not equal the delta and what the numerical alternatives are for this issue?

• I can only imagine option with non-smooth value, like barrier option close to the barrier. In this case numerical derivative might give result very different from analytical one. Could it be your case? – Rustam Jun 26 '13 at 19:26
• hmmm not really, as I used standard Matlab built-in functions and tested it with the standard Black-Scholes formula (hence --blsprice-- for calculating option prices, --blsdelta-- for calculating the delta's and --gradient-- for the numerically obtaining the delta). – JohnAndrews Jun 27 '13 at 13:32
• That's really interesting. I never used gradient function to calculate derivatives manually. In case C(:) is vector of call prices and S(:) is vector of spot prices, I calculate delta numerically like this: Delta = diff(C)./diff(S). – Rustam Jun 27 '13 at 13:37
• But basically I'd suggest you to check if your black-scholes price coincides with Matlab's blsprice. – Rustam Jun 27 '13 at 13:39
• Thanks. Yes it does coincide, actually I read that your method diff(C)/diff(S) is an approximation. When I try it it comes close to the blsdelta(.) deltas, but there is still a difference. I assume you input for C(:) the estimated option prices, not the actual ones. – JohnAndrews Jun 27 '13 at 13:52

## 2 Answers

This is in fact a tricky matter.

As you say one way is to calculate delta by an analytic formula, i.e. calculate the first derivative of the option pricing formula you are using with respect to the underlying's spot price.

The second way is to do it numerically, i.e. change the spot price by a small value $dS$, calculate the value of the option and then calculate the delta as a difference quotient: $delta = \frac{V(S+dS)-V(S)}{dS}$.

When changing the spot price and calculating $V(S+dS)$ there are two possibilities:
1. change spot price by $dS$, all other parameters (including volatility) stay unchanged, then price the option and calculate the delta as shown above.
2. change spot price by $dS$, take volatility from the volatility surface, then price the option and calculate the delta as shown above.

Which method is the best very much depends on the dynamics of the volatility surface and many subtleties have to be taken into consideration here. This is also related to the so called Sticky Delta vs. Sticky Strike problem and there's no correct solution all the time.

For a good overview and introduction see here:
Laughter in the Dark - The Problem of the Volatility Smile by Emanual Derman and especially
Regimes of Volatility by the same author.

• Thank you, good and clear answer. I will try it and read your references next week & come back to you. – JohnAndrews Jul 1 '13 at 16:27
• Nice reference, how do you always get to dig up such gems? +1 – Matt Jul 2 '13 at 3:59
• +1 for Emanual Derman's lecture notes - I find his explanations very intuitive – Steve Lorimer Jul 5 '13 at 7:19
• www.emanuelderman.com/media/euronext-volatility_smile.pdf – Beginner Sep 1 '17 at 16:22

It may be the case with certain exotics that greeks are derived analytically through approximations. In that case at certain boundaries you may get different results from such approximation over the numerical approach. Why do you not approach the numerical case similarly than most banks and hedge funds when they "shock" their options books: Simply shift your underlying, re-calculate the option price, derive a convexity adjustment factor, and from both approximate your delta.