Risk & GreeksNumerical MethodsBump-RevalComplex-Step Differentiation

Numerical Differentiation and Bump-Reval

Module 2 of 418 min readLevel: Medium

Setup

When Analytic Greeks Are Not Available

The Black-Scholes Greeks derived in the previous module are available in closed form because the pricing function C(S,K,r,σ,T)C(S, K, r, \sigma, T) is differentiable and explicit. In practice, most pricing functions used on a derivatives desk are not:

  • Exotic options (barriers, Asians, lookbacks) have prices computed by Monte Carlo or finite difference solvers — no analytic formula.
  • Stochastic vol models (Heston, SABR) have semi-analytic prices but whose derivatives with respect to model parameters involve numerical quadrature.
  • Calibrated models where the volatility surface itself depends on the market inputs in a non-trivial way.

For all such cases, bump-reval (finite difference approximation of derivatives) is the standard method on trading desks. It is computationally expensive but model-agnostic: the same procedure works for any pricing function.

Notation

Let f:RnRf: \mathbb{R}^n \to \mathbb{R} be a pricing function. We want to estimate the partial derivative f/xi\partial f / \partial x_i at a base point x\mathbf{x}. The bump-reval approach: evaluate ff at a perturbed point x+hei\mathbf{x} + h\,\mathbf{e}_i (where ei\mathbf{e}_i is the ii-th unit vector and hh is the bump size), and form a finite difference quotient.


Forward Differences

fxif(x+hei)f(x)h.\frac{\partial f}{\partial x_i} \approx \frac{f(\mathbf{x} + h\,\mathbf{e}_i) - f(\mathbf{x})}{h}.

Error analysis. By Taylor expansion:

f(x+hei)=f(x)+hfxi+h222fxi2+O(h3).f(\mathbf{x} + h\,\mathbf{e}_i) = f(\mathbf{x}) + h\frac{\partial f}{\partial x_i} + \frac{h^2}{2}\frac{\partial^2 f}{\partial x_i^2} + O(h^3).

Subtracting and dividing by hh:

f(x+hei)f(x)h=fxi+h22fxi2+O(h2).\frac{f(\mathbf{x} + h\,\mathbf{e}_i) - f(\mathbf{x})}{h} = \frac{\partial f}{\partial x_i} + \frac{h}{2}\frac{\partial^2 f}{\partial x_i^2} + O(h^2).

The truncation error is O(h)O(h): first-order accurate. The error decreases linearly as the bump hh shrinks.

Cost: 1 repricing per Greek (plus the base price). For nn inputs: n+1n + 1 total repricings.


Backward Differences

fxif(x)f(xhei)h.\frac{\partial f}{\partial x_i} \approx \frac{f(\mathbf{x}) - f(\mathbf{x} - h\,\mathbf{e}_i)}{h}.

Truncation error is also O(h)O(h), with the same leading coefficient but opposite sign:

f(x)f(xhei)h=fxih22fxi2+O(h2).\frac{f(\mathbf{x}) - f(\mathbf{x} - h\,\mathbf{e}_i)}{h} = \frac{\partial f}{\partial x_i} - \frac{h}{2}\frac{\partial^2 f}{\partial x_i^2} + O(h^2).

Forward and backward differences have the same O(h)O(h) accuracy. Backward difference is useful when a positive bump is not feasible (e.g., interest rates near zero cannot be bumped upward without changing the sign regime).


Central Differences

fxif(x+hei)f(xhei)2h.\frac{\partial f}{\partial x_i} \approx \frac{f(\mathbf{x} + h\,\mathbf{e}_i) - f(\mathbf{x} - h\,\mathbf{e}_i)}{2h}.

Error analysis. Subtract the two Taylor expansions:

f(x+h)=f+hf+h22f+h36f+O(h4),f(\mathbf{x} + h) = f + h f' + \frac{h^2}{2}f'' + \frac{h^3}{6}f''' + O(h^4), f(xh)=fhf+h22fh36f+O(h4).f(\mathbf{x} - h) = f - h f' + \frac{h^2}{2}f'' - \frac{h^3}{6}f''' + O(h^4).

Subtracting: f(x+h)f(xh)=2hf+h33f+O(h5)f(\mathbf{x}+h) - f(\mathbf{x}-h) = 2hf' + \frac{h^3}{3}f''' + O(h^5). Dividing by 2h2h:

f(x+h)f(xh)2h=f+h26f+O(h4).\frac{f(\mathbf{x}+h) - f(\mathbf{x}-h)}{2h} = f' + \frac{h^2}{6}f''' + O(h^4).

The truncation error is O(h2)O(h^2): second-order accurate. Central differences are far more accurate than one-sided differences at the same bump size.

Cost: 2 repricings per Greek (up and down bump). No base-price reuse possible. For nn inputs: 2n2n repricings.

Second-Order Derivative (for Gamma)

2fxi2f(x+hei)2f(x)+f(xhei)h2.\frac{\partial^2 f}{\partial x_i^2} \approx \frac{f(\mathbf{x} + h\,\mathbf{e}_i) - 2f(\mathbf{x}) + f(\mathbf{x} - h\,\mathbf{e}_i)}{h^2}.

Error: Adding the two Taylor expansions: f(x+h)+f(xh)=2f+h2f+h412f(4)+O(h6)f(\mathbf{x}+h) + f(\mathbf{x}-h) = 2f + h^2 f'' + \frac{h^4}{12}f^{(4)} + O(h^6). Subtracting 2f2f and dividing by h2h^2: truncation error O(h2)O(h^2).

Gamma via bump-reval uses this formula with xi=Sx_i = S, bump h=ϵSh = \epsilon \cdot S (a relative bump of typically ϵ=1%\epsilon = 1\%):

Γ^=C(S+h)2C(S)+C(Sh)h2.\hat{\Gamma} = \frac{C(S+h) - 2C(S) + C(S-h)}{h^2}.

Cost: 2 additional repricings (the up and down bumps also give delta via central difference, so gamma is free once delta is computed by central differences).


Step Size Selection: The Accuracy-Stability Tradeoff

There are two sources of error in numerical differentiation:

  1. Truncation error: from the Taylor approximation. For central differences: h26f/f\sim \frac{h^2}{6}|f'''|/|f'| (relative).
  2. Round-off error: from finite-precision arithmetic. The computed value of f(x+h)f(\mathbf{x}+h) carries a rounding error of order εmachf\varepsilon_{\mathrm{mach}} \cdot |f|, where εmach1016\varepsilon_{\mathrm{mach}} \approx 10^{-16} (double precision). The finite difference quotient amplifies this by 1/h1/h: round-off error εmachf/h\sim \varepsilon_{\mathrm{mach}} |f| / h.

The full lesson requires Premium

The complete derivation, the C++ / Python implementation, the validation tables, the quiz, and the interview-angle notes are part of Premium. Start a Premium plan to unlock every module in this track.