Skip to content
All library documents

Calculating Black-Scholes Implied Volatility from Market Prices

Article Quant Q&A · Author: suncup224

Summary

The document explains that implied volatility is found by reversing the Black-Scholes pricing calculation: given an observed option price, solve for the volatility that makes the model reproduce that price. It presents Newton-Raphson iteration as one numerical approach and provides an implementation for European calls and puts, including dividends, a pricing function, and vega for the update step.

The suggested workflow is to feed the observed market price into the solver, then substitute the resulting volatility back into the pricing function to check the fit. No separate source containing the answer is needed because the market option price is the target. The document also briefly raises model-free variance swaps but does not explain or implement that alternative. The code is presented as an approximation and does not discuss robust stopping limits, invalid inputs, or failure handling, so its numerical safeguards are limited.

Key ideas

  • Implied volatility is the volatility that makes a pricing model match an observed option price.
  • Newton-Raphson updates volatility using the difference between modeled and observed prices and the option’s vega.
  • The resulting estimate can be checked by repricing the option with that volatility.
  • The document mentions model-free variance swaps but does not provide a practical method for them.

Tags

Full text
# Two different ways of pricing that leads to two answers


# Two different ways of pricing that leads to two answers












This question might appear trivial to many (considering the questions on this site), but I think it reflects something fundamental that I am missing.

To keep things simple, assume everyone is risk-neutral and there is no inflation etc, so that prices are determined using expected values.

Let us be in year 0. Consider an asset that pays \$1 in year 1 and \$1 in year 2. Let $r_{01}$ and $r_{02}$ denote the (annually compounded) 1-year spot rate and 2-year spot rate respectively. The standard textbook way to price this asset is:

$$P_0 = \frac{1}{1+r_{01}} + \frac{1}{(1+r_{02})^2}$$

Here is an alternative approach that seems reasonable. We have $P_0 = \frac{1}{1+r_{01}} + \frac{E[P_1]}{1+r_{01}}$ where $P_1$ is the expected price the asset will fetch in year 1. At time 0, $P_1$ is still a random variable and it is calculated by $P_1 = \frac{1}{1+r_{12}}$ where $r_{12}$ is the one-year spot rate when we are in year 1 (hence this is a random variable at year 0). In this case,

$$P_0 = \frac{1}{1+r_{01}} + \frac{E[P_1]}{1+r_{01}} = \frac{1}{1+r_{01}} + E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$

If these two pricing methods are to be equal, then one needs

$$ \frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$

It does not appear to me that this must be so. In fact, I think it is the case that $(1+r_{01})E(1+r_{12})=(1+r_{02})^2$ [by considering the expected amount \$1 under a two-year strip or rollover one-year strips will earn; if LHS>RHS, then borrow \$1 cash using $(1+r_{02})^2$ units of 2-year strips and lend out all that cash on $1+r_{01}$ units of 1-year strips and lent out all earnings again at end of year 1 on $(1+r_{01})(1+r_{12})$ units of 1-year strip to make profit in year 2 in expectation]. Since $E(1/X)\neq 1/E(X)$ in general, the two pricing methods cannot lead to equal outcomes. How do I resolve this contradiction?

## Answer by Mark Joshi (score 7, accepted)

https://quant.stackexchange.com/a/18718

$$\frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$

Indeed, in the pricing measure, the distribution of $r_{12}$ has to be such that this relation holds.

If you look at drift derivations for the LIBOR market model, a lot of work goes into making this sort of equation hold.

## Answer by Gordon (score 4)

https://quant.stackexchange.com/a/18726

There is no conflict here. In the identity, \begin{align*} \frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}, \end{align*} the expectation is under the year-1 forward measure. However, in the identity \begin{align*} (1+r_{01})E(1+r_{12})=(1+r_{02})^2, \end{align*} the expectation is under the year-2 forward measure.

For illustration, let $P(t, u)$ be the price at time $t$ of a zero-coupon bond with maturity $u$ and unit face value. Moreover, let $B_t$ be the money market account (or deposit account) value at time $t$. For notations, let $T_1=1$ and $T_2=2$. Then \begin{align*} r_{12} &\triangleq L(T_1; T_1, T_2)\\ &=\frac{1}{T_2-T_1}\left(\frac{P(T_1, T_1)}{P(T_1, T_2)}-1\right)\\ &=\frac{1}{P(T_1, T_2)}-1. \end{align*} We also note that $ P(0, T_1) = \frac{1}{1+r_{01}}, $ and $ P(0, T_2) = \frac{1}{(1+r_{02})^2}. $ Let $E$, $E_1$, and $E_2$ be respectively the expectation operators under the risk-neutral measure $P$, the year-1 forward measure $P_1$ and the year-2 forward measure $P_2$.

It is well known that the process $\{L(t; T_1, T_2) \mid 0\leq t \leq T_1 \}$ is a martingale under the year-2 forward measure. Then \begin{align*} E_2(1+r_{12}) &= E_2(1+L(T_1; T_1, T_2))\\ &= 1+ L(0; T_1, T_2)\\ &= \frac{P(0, T_1)}{P(0, T_2)}\\ &= \frac{(1+r_{02})^2}{1+r_{01}}. \end{align*} That is, \begin{align*} (1+r_{01})E_2(1+r_{12})=(1+r_{02})^2. \end{align*}

On the other hand, note that, for $0 \leq t \leq T_1$, \begin{align*} \frac{dP}{dP_1}\big|_t = \frac{B_t P(0, T_1)}{P(t, T_1)}. \end{align*} Then, \begin{align*} \frac{1}{(1+r_{02})^2} &= P(0, T_2)\\ &= E\left(\frac{1}{B_{T_2}}\right)\\ &= E\left(\frac{1}{B_{T_1}}E\left(\frac{B_{T_1}}{B_{T_2}} \mid \mathcal{F}_{T_1}\right)\right)\\ &= E\left(\frac{1}{B_{T_1}} P(T_1, T_2)\right)\\ &= E_1\left(\frac{dP}{dP_1}\big|_{T_1} \frac{1}{B_{T_1}} P(T_1, T_2)\right)\\ &= P(0, T_1)E_1(P(T_1, T_2))\\ &= P(0, T_1)E_1\left(\frac{1}{1+r_{12}}\right)\\ &= \frac{1}{1+r_{01}}E_1\left(\frac{1}{1+r_{12}}\right), \end{align*} where $\mathcal{F}_{T_1}$ is the information set at time $T_1$. That is, \begin{align*} \frac{1}{(1+r_{02})^2} = E_1\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}. \end{align*}

EDIT: The last identity can also be shown by the measure change between the forward measures $P_1$ and $P_2$. Specifically, for $0 \leq t \leq T_1$, \begin{align*} \frac{dP_1}{dP_2}\big|_t = \frac{P(t, T_1)P(0, T_2)}{P(t, T_2)P(0, T_1)}. \end{align*} Consequently, \begin{align*} E_1\left(\frac{1}{1+r_{12}}\right) &= E_1\left(P(T_1, T_2)\right)\\ &= E_2\left(\frac{dP_1}{dP_2}\big|_{T_1} P(T_1, T_2)\right)\\ &= \frac{P(0, T_2)}{P(0, T_1)}\\ &= \frac{1+r_{01}}{(1+r_{02})^2}. \end{align*}

## Answer by emcor (score 0)

https://quant.stackexchange.com/a/18728

If the prices were not equal, there would be an immediate arbitrage opportunity as you can lock in the forward rate today. Hence the law of one price holds.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.