Root Finding: Implied Volatility#
Pricing engines go from a volatility to a price. Markets quote the other way: an option has a price, and the volatility that reproduces it, the implied volatility, is the number that traders and controllers compare. Finding it is a root-finding problem, and the most common one in quantitative finance. This page sets out the standard methods, shows how they differ in speed and in reliability on awkward cases, and what to check when there is no solution.
The problem#
Given a market price \(C^{mkt}\), find \(\sigma\) such that
The price rises with the volatility, so \(f\) is increasing and the root, if it exists, is unique. It exists if the price lies between the no-arbitrage bounds, \(\max(S - Ke^{-rT}, 0) \le C \le S\).
The slope of \(f\) is the vega, and its curvature is the vomma, with \(F = S e^{rT}\), \(d_{1,2} = \big( \ln(F/K) \pm \tfrac12 \sigma^2 T \big) / (\sigma\sqrt{T})\):
Since \(d_1 d_2 = \big( \ln^2(F/K) - \tfrac14 \sigma^4 T^2 \big) / (\sigma^2 T)\), the price is convex in \(\sigma\) below \(\sigma_{\ast} = \sqrt{2\,|\ln(F/K)|/T}\) and concave above it. The point \(\sigma_\ast\) is an inflection point, and it decides where Newton’s method is safe. At the money \(\sigma_\ast = 0\) and the price is concave everywhere. The vega is also small when the option is far from the money or close to expiry, and a small vega means that a large change in volatility moves the price very little:
so a given tolerance in price is a much looser tolerance in volatility for these options.
How fast a method converges#
Let \(e_n = \sigma_n - \sigma^\ast\) be the error after \(n\) steps. A method has order \(p\) if \(|e_{n+1}| \approx C\,|e_n|^p\) close to the root. Order 1 is linear convergence, with a fixed number of digits gained per step. Order 2 is quadratic, and the number of correct digits doubles. The order is not the whole story, since a step may need more than one evaluation of the price, and a method may fail to converge at all, which is why the guarantees below matter.
The methods#
Bisection. Start with a bracket \([a, b]\) where \(f\) changes sign, \(f(a)\,f(b) < 0\), and take the midpoint \(m = \tfrac12 (a + b)\). Keep the half in which the sign still changes. The width of the bracket halves at every step, so after \(n\) steps the root is known to within \((b - a)/2^{n}\), and to reach a tolerance \(\epsilon\) in the volatility needs
steps. For the bracket \([0.0001, 5]\) and \(\epsilon = 10^{-10}\) that is 36. The method is of order 1, with a gain of 0.3 digits per step. It always converges, whatever the shape of \(f\), which is why it is the fallback for the others. It is slow and safe.
Newton-Raphson. Replace \(f\) near the current point by its tangent, \(f(\sigma_n + \delta) \approx f(\sigma_n) + f'(\sigma_n)\,\delta\), and jump to the root of the tangent line:
where \(\mathcal{V}\) is the vega, which is the derivative of the price, known in closed form. Expanding \(f\) about \(\sigma_n\) to second order and evaluating at the root, \(0 = f(\sigma_n) - f'(\sigma_n)\,e_n + \tfrac12 f''(\xi)\,e_n^2\), gives the error recursion
The method is of order 2: close to the root the number of correct digits doubles at each step, and it takes 3 to 7 iterations. The recursion also shows how it fails. The constant \(f''/(2f')\) is large where the vega is small, so far from the money, at short maturities or at a poor start, the quadratic term is not small and the step is wrong. In the convex region, \(\sigma < \sigma_\ast\), the tangent lies below the curve and the iterates approach the root from one side without overshooting, after the first step. In the concave region the tangent lies above the curve, and a step from a point well above the root can land at \(\sigma \le 0\), which is outside the allowed range. Starting at the inflection point \(\sigma_\ast\), or from the approximation \(\sigma_0 \approx \sqrt{2\pi/T}\;C/S\) for an at-the-money option, gives a safe start.
Secant. Newton with the derivative replaced by the slope through the last two points:
It needs no vega, and one new price per step. The error recursion is \(e_{n+1} \approx \frac{f''}{2f'}\,e_n\,e_{n-1}\), so the order \(p\) satisfies \(p^2 = p + 1\), and \(p = (1 + \sqrt5)/2 \approx 1.618\). It is slower per step than Newton, and cheaper per step when the derivative costs as much as the price. It has the same weaknesses, and a further one: if \(f(\sigma_n) = f(\sigma_{n-1})\) to machine precision the step is undefined.
Brent. Works within a bracket \([a, b]\) and uses the fastest step that is safe. Given three points \(a, b, c\) with values \(f_a, f_b, f_c\), inverse quadratic interpolation fits \(\sigma\) as a quadratic in \(f\) through them and evaluates it at \(f = 0\):
When only two points are usable, the secant step is taken. The new point is accepted only if it falls inside the bracket and the bracket is shrinking quickly enough. Otherwise a bisection step is taken. The order is about 1.84, the root of \(p^3 = p^2 + p + 1\), in good cases, and the guarantee of bisection holds in all of them, with the bracket never lost. It is as safe as bisection and nearly as fast as Newton. It is the standard choice when the derivative is not available or not trusted.
Safeguarded Newton. Keep a bracket \([a, b]\) around the root, updated at every point \(\sigma_n\) that is evaluated. Because \(f\) is increasing, \(f(\sigma_n) < 0\) means the root is above, so \(a \leftarrow \sigma_n\), and otherwise \(b \leftarrow \sigma_n\). Then take the step
It keeps Newton’s order 2 where Newton works, and the guarantee of bisection where it does not: the bracket shrinks at every step, and the number of steps is at worst that of bisection, plus the few that Newton wastes.
Method |
Order |
Needs the vega |
Bracket needed |
Guaranteed to converge |
|---|---|---|---|---|
Bisection |
1 |
no |
yes |
yes, in \(\lceil \log_2 ((b-a)/\epsilon) \rceil\) steps |
Newton |
2 |
yes |
no |
no. Fails from a poor start or a small vega |
Secant |
1.62 |
no |
no |
no |
Brent |
up to 1.84 |
no |
yes |
yes |
Safeguarded Newton |
2 |
yes |
yes |
yes |
Several unknowns#
When there are \(n\) equations in \(n\) unknowns, \(f(x) = 0\) with \(f : \mathbb{R}^n \to \mathbb{R}^n\), Newton’s method solves the linearised system at each step,
where \(J\) is the matrix of first derivatives, the Jacobian, and the scalar derivative, the vega, is the case \(n = 1\). Bracketing has no simple equivalent, and so the safeguards are a limit on the step and a line search. A Jacobian that is approximate or frozen slows the convergence from quadratic to linear. The matrix, and what its quality does, are set out in The Jacobian.
Worked example#
The example finds the implied volatility of four options of different types, using each method with a tolerance of \(10^{-10}\) in the price. It then starts Newton from a poor guess, and tests prices that are inside and outside the no-arbitrage bounds.
Python code
"""Implied volatility as a root-finding problem: bisection, Newton, secant, Brent and a safeguarded Newton."""
import numpy as np
from scipy.optimize import brentq
from common import bs_greeks, bs_price
R_RATE = 0.03
CASES = [ # label, spot, strike, expiry, true volatility
("At the money, 1 year", 100.0, 100.0, 1.0, 0.20),
("Out of the money, strike 160", 100.0, 160.0, 1.0, 0.20),
("Short dated, 2 weeks, strike 108", 100.0, 108.0, 0.04, 0.25),
("High volatility, 150%", 100.0, 100.0, 1.0, 1.50),
]
def make(s, k, t, target):
price = lambda sigma: bs_price(s, k, R_RATE, sigma, t)
vega = lambda sigma: bs_greeks(s, k, R_RATE, sigma, t)[2]
return (lambda sigma: price(sigma) - target), vega
def bisection(f, lo, hi, tol=1e-10):
for i in range(1, 200):
mid = 0.5 * (lo + hi)
if abs(f(mid)) < tol:
return mid, i, True
lo, hi = (mid, hi) if f(lo) * f(mid) > 0 else (lo, mid)
return mid, 200, False
def newton(f, vega, x0, tol=1e-10):
x = x0
for i in range(1, 100):
if abs(f(x)) < tol:
return x, i - 1, True
slope = vega(x)
if slope < 1e-14 or not np.isfinite(slope):
return x, i, False
x = x - f(x) / slope
if not np.isfinite(x) or x <= 0 or x > 50:
return x, i, False
return x, 100, False
def secant(f, x0, x1, tol=1e-10):
for i in range(1, 100):
if abs(f(x1)) < tol:
return x1, i, True
denom = f(x1) - f(x0)
if denom == 0 or not np.isfinite(denom):
return x1, i, False
x0, x1 = x1, x1 - f(x1) * (x1 - x0) / denom
if not np.isfinite(x1) or x1 <= 0:
return x1, i, False
return x1, 100, False
def safeguarded_newton(f, vega, lo, hi, x0, tol=1e-10):
"""Newton steps inside a bracket that is shrunk every iteration; a step that leaves it is replaced by bisection."""
x = x0
for i in range(1, 200):
fx = f(x)
if abs(fx) < tol:
return x, i - 1, True
lo, hi = (x, hi) if fx < 0 else (lo, x)
slope = vega(x)
step = x - fx / slope if slope > 1e-14 else None
x = step if step is not None and lo < step < hi else 0.5 * (lo + hi)
return x, 200, False
def show(name, result, truth):
x, iters, ok = result
text = f"{x:8.5f}" if ok else " fails"
err = f"{abs(x - truth):.0e}" if ok else "-"
return f"{iters:>4} {text} {err:>6}"
if __name__ == "__main__":
print("Iterations, result and error for each method. The target is hit when the price error is below 1e-10.")
print("Newton and the secant method start from 0.5 (and 0.4); bisection and Brent use the bracket [0.0001, 5].\n")
header = f"{'Case':<34} {'Price':>8} | {'Bisection':<20} | {'Newton':<20} | {'Secant':<20} | {'Brent':<20} | {'Safeguarded Newton':<20}"
print(header)
for label, s, k, t, sigma in CASES:
target = bs_price(s, k, R_RATE, sigma, t)
f, vega = make(s, k, t, target)
brent_root, info = brentq(f, 1e-4, 5.0, xtol=1e-14, full_output=True)
cells = [show("b", bisection(f, 1e-4, 5.0), sigma), show("n", newton(f, vega, 0.5), sigma),
show("s", secant(f, 0.5, 0.4), sigma), show("br", (brent_root, info.iterations, True), sigma),
show("sn", safeguarded_newton(f, vega, 1e-4, 5.0, 0.5), sigma)]
print(f"{label:<34} {target:8.5f} | " + " | ".join(f"{c:<20}" for c in cells))
print("\nNewton from a poor start (2.0) on the out-of-the-money case, where vega is small:")
label, s, k, t, sigma = CASES[1]
f, vega = make(s, k, t, bs_price(s, k, R_RATE, sigma, t))
print(f" vega at 2.0 is {vega(2.0):.4f} and at the answer {vega(sigma):.4f}; Newton: {show('n', newton(f, vega, 2.0), sigma).strip()}")
print(f" safeguarded Newton from the same start: {show('sn', safeguarded_newton(f, vega, 1e-4, 5.0, 2.0), sigma).strip()}")
print("\nA price outside the no-arbitrage bounds has no implied volatility:")
s, k, t = 100.0, 100.0, 1.0
lower = max(s - k * np.exp(-R_RATE * t), 0.0)
for price in (lower - 0.05, 9.4134, s + 1.0):
ok = lower <= price <= s
print(f" call price {price:8.4f}: bounds [{lower:.4f}, {s:.4f}] -> {'implied volatility exists' if ok else 'no solution, reject the price'}")
The output is:
Iterations, result and error for each method. The target is hit when the price error is below 1e-10.
Newton and the secant method start from 0.5 (and 0.4); bisection and Brent use the bracket [0.0001, 5].
Case Price | Bisection | Newton | Secant | Brent | Safeguarded Newton
At the money, 1 year 9.41340 | 39 0.20000 2e-12 | 3 0.20000 7e-15 | 5 0.20000 8e-17 | 7 0.20000 2e-15 | 3 0.20000 7e-15
Out of the money, strike 160 0.12130 | 36 0.20000 7e-12 | 7 0.20000 6e-16 | 10 0.20000 1e-13 | 19 0.20000 2e-16 | 7 0.20000 6e-16
Short dated, 2 weeks, strike 108 0.14695 | 36 0.25000 3e-11 | 5 0.25000 1e-12 | 8 0.25000 2e-15 | 18 0.25000 9e-16 | 5 0.25000 1e-12
High volatility, 150% 55.35321 | 39 1.50000 6e-13 | 4 1.50000 4e-14 | 7 1.50000 2e-16 | 8 1.50000 0e+00 | 4 1.50000 4e-14
Newton from a poor start (2.0) on the out-of-the-money case, where vega is small:
vega at 2.0 is 29.4305 and at the answer 4.3982; Newton: 1 fails -
safeguarded Newton from the same start: 8 0.20000 1e-12
A price outside the no-arbitrage bounds has no implied volatility:
call price 2.9054: bounds [2.9554, 100.0000] -> no solution, reject the price
call price 9.4134: bounds [2.9554, 100.0000] -> implied volatility exists
call price 101.0000: bounds [2.9554, 100.0000] -> no solution, reject the price
Reading the output:
All the methods find the answer when they converge, to an accuracy of \(10^{-11}\) or better.
The cost differs a great deal. Bisection takes 36 to 39 iterations on every case, as the \(\lceil \log_2 ((b-a)/\epsilon) \rceil = 36\) of the formula says, whatever the option. Newton takes 3 to 7, Brent 7 to 19 and the secant method 5 to 10. Newton is five to thirteen times faster than bisection, and for millions of options on a surface that matters.
The out-of-the-money option is the hardest. Newton takes 7 iterations against 3 at the money, and Brent 19 against 7, since the price is a very flat function of volatility.
Newton can fail outright. The inflection point of the out-of-the-money case is \(\sigma_\ast = \sqrt{2\,|\ln(F/K)|/T} = 0.94\). A start of 2.0 is above it, where the price is concave, and the tangent root is at a negative volatility: the first step leaves the allowed range and the method stops. Safeguarded Newton, from the same start, finds the answer in 8 iterations.
Not every price has a volatility. A call at 2.9054 is below the intrinsic value of 2.9554, and a call at 101 is above the stock. Both are rejected, as they should be, before the search, and not by a failed iteration.
A valuation control view#
Reject prices outside the no-arbitrage bounds first: a market price that is below intrinsic value, or above the stock, is a data error, and a solver that returns a number for it, or fails silently, hides it. Check parity between the call and put for the same strike too.
Use a safe method for production: a bracketed method, or Newton with a safeguard. A pure Newton solver that fails for 0.1% of options on a surface leaves holes that are filled by interpolation, and nobody sees them.
Report the failures: the count of options for which no volatility was found, with the reason. A rise from one day to the next is a signal about the market data.
Set the tolerance in price and in volatility: a tolerance of \(10^{-10}\) in the price can still leave a large error in the volatility where the vega is small, which is the case for the far out-of-the-money options that matter for the tails.
Be consistent between the desk and the control: an implied volatility is only a convention for quoting a price. The two sides must use the same model (lognormal or normal), day count, forward and discount curve, or the numbers differ without any difference in the price. See Interest Rate Volatility, Part 2: The Bachelier (Normal) Model.
Next, Numerical Differentiation covers how the derivatives that Newton’s method and the Greeks need are computed when there is no formula.