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.

Optimal hh: minimise total error h26f/f+εmachf/(hf)\sim \frac{h^2}{6}|f'''|/|f'| + \varepsilon_{\mathrm{mach}}|f|/(h|f'|). Setting the derivative to zero:

h(3εmachff)1/3(ff)1/3εmach1/3105(for central differences with typical smooth functions).h^* \sim \left(\frac{3\varepsilon_{\mathrm{mach}}|f|}{|f'''|}\right)^{1/3} \approx \left(\frac{|f|}{|f'''|}\right)^{1/3} \cdot \varepsilon_{\mathrm{mach}}^{1/3} \approx 10^{-5} \quad \text{(for central differences with typical smooth functions)}.

For forward differences, the optimal hεmach108h^* \approx \sqrt{\varepsilon_{\mathrm{mach}}} \approx 10^{-8}.

In practice: relative bumps (e.g., h=0.01σh = 0.01\sigma for vega, h=0.01Sh = 0.01S for delta) are used rather than absolute bumps, to ensure scale-invariance.


Complex-Step Differentiation

Principle

The complex-step method achieves near-machine-precision accuracy for derivatives without the cancellation error that limits finite differences.

For an analytic function f:RRf: \mathbb{R} \to \mathbb{R} extended to C\mathbb{C}, evaluate at the complex point x+ihx + ih for real hh:

f(x+ih)=f(x)+ihf(x)h22f(x)ih36f(x)+O(h4).f(x + ih) = f(x) + ih f'(x) - \frac{h^2}{2}f''(x) - \frac{ih^3}{6}f'''(x) + O(h^4).

Taking the imaginary part: Im[f(x+ih)]=hf(x)h36f(x)+O(h5).\mathrm{Im}[f(x + ih)] = h f'(x) - \frac{h^3}{6}f'''(x) + O(h^5).

Therefore: f(x)Im[f(x+ih)]h,truncation error O(h2).f'(x) \approx \frac{\mathrm{Im}[f(x + ih)]}{h}, \qquad \text{truncation error } O(h^2).

Critical advantage. No subtraction of nearly equal numbers occurs (the real and imaginary parts are computed separately). The round-off error is εmachf\sim \varepsilon_{\mathrm{mach}} \cdot |f| (same order as the function value), not amplified by 1/h1/h. We can safely take h=1050h = 10^{-50} or even h=10200h = 10^{-200}, achieving accuracy limited only by the truncation error O(h2)0O(h^2) \approx 0 — effectively machine precision.

Requirements

The pricing function ff must be analytically continuable to complex inputs. Most standard pricing functions (Black-Scholes, characteristic function models, deterministic pricing routines) are analytic. Monte Carlo estimators with indicator functions (e.g., 1ST>K\mathbf{1}_{S_T > K}) are not analytic — the indicator is a step function and does not extend to C\mathbb{C}. For such cases, a smooth approximation to the indicator is needed, or the complex-step method applies only to smooth ingredients (e.g., the Black-Scholes component in a hybrid model).

Comparison Table

MethodAccuracyCost per GreekRound-off safe?
Forward differenceO(h)O(h)1 repriceNo (subtractive cancellation)
Central differenceO(h2)O(h^2)2 repricingsNo
Complex stepO(h2)O(h^2) — effectively exact1 complex repriceYes (no cancellation)

Structured Bump Schedule for Ladder Construction

What a Bump Schedule Is

A bump schedule is a systematic list of: what market inputs to bump, by how much, and in what direction (up, down, both). For a derivatives book with exposures to many risk factors, the bump schedule must be comprehensive and internally consistent.

Standard bump sizes (conventions vary by desk; these are indicative):

Risk factorBump typeTypical size
Spot (delta)Relative, central±1%\pm 1\% of spot
Spot (gamma)Relative, central±1%\pm 1\% of spot
Implied vol (vega)Absolute, parallel±1\pm 1 vol point (0.01 in decimal)
Interest rate (rho)Absolute±1\pm 1 basis point (0.0001)
Time (theta)Forward+1+1 calendar day
Dividend yieldAbsolute±1\pm 1 basis point

Vega Ladder Construction

A vega ladder is the vega sensitivity to each pillar of the implied vol surface. For a surface parametrised by strikes {Ki}i=1M\{K_i\}_{i=1}^{M} and maturities {Tj}j=1N\{T_j\}_{j=1}^{N}:

νij=Vσ^(Ki,Tj),i=1,,M,  j=1,,N.\nu_{ij} = \frac{\partial V}{\partial \hat{\sigma}(K_i, T_j)}, \qquad i = 1, \ldots, M,\; j = 1, \ldots, N.

Computed by bumping σ^(Ki,Tj)\hat{\sigma}(K_i, T_j) by Δσ=0.01\Delta\sigma = 0.01 at each pillar and re-pricing. The vega ladder has M×NM \times N entries — for a typical surface with 5 tenors and 7 strikes, that is 35 repricings per position per time step. For a book of 5000 positions, this is 175,000 repricings per risk run — a significant computational load.

Vega bucketing: sum the vega ladder entries by maturity to get the total vega per tenor (term structure of vega). This is the most commonly reported risk metric for options books.

Delta Ladder for Fixed Income

For a fixed-income book, delta is replaced by DV01 (dollar value of a basis point):

DV01=Vr×0.0001.\mathrm{DV01} = -\frac{\partial V}{\partial r} \times 0.0001.

A DV01 ladder shows the sensitivity to a 1bp parallel shift at each tenor point of the yield curve. Computed by bumping each tenor rate by 1bp and repricing (30–50 repricings per position for a detailed curve).


Limitations

Bump size sensitivity. For options near a barrier or near expiry, the pricing function has large second and third derivatives; the optimal bump size is very small. Too large a bump introduces truncation error; too small amplifies round-off. For these cases, analytic Greeks (when available) or complex-step are strongly preferred.

Computational cost. A full bump-reval run for a large options book can take minutes to hours, depending on the model. Techniques to reduce cost: (1) analytic Greeks where available, (2) adjoint algorithmic differentiation (AAD), which computes all nn partial derivatives in a single backward sweep at cost O(1)O(1) times the forward model evaluation (rather than O(n)O(n) for bump-reval).

Adjoint Differentiation (AAD). For models where the pricing function can be automatically differentiated in reverse mode, AAD computes the full gradient xf\nabla_\mathbf{x} f in roughly 335×5\times the cost of a single function evaluation, regardless of the number of parameters. This is the industry-standard approach for high-dimensional Greeks in Monte Carlo and is implemented in major risk engines (Murex, Calypso, and in-house systems at major banks).

Consistency of bump and model. When bumping the implied vol surface, the bump must be consistent with the interpolation scheme: bumping a single pillar may produce an arbitrage-violating surface (butterfly positivity violated) if not done carefully. Structured bump schedules must include an arbitrage check after each pillar bump.


Interview Angle

L1. What is the truncation error of central differences? Why is it preferred over forward differences for delta computation?

Central difference error is O(h2)O(h^2) vs. O(h)O(h) for forward differences — one order better. For the same bump size h=0.01Sh = 0.01S, central difference is 100×\sim 100\times more accurate at typical bump sizes. The extra cost is one additional repricing (up and down instead of just up), which is acceptable. Central differences also give an exact second-order derivative (gamma) from the same two repricings.

L2. Derive the optimal bump size for central differences, balancing truncation and round-off error. Explain why the complex-step method avoids this tradeoff.

Truncation error h26f\approx \frac{h^2}{6}|f'''|. Round-off error εmachfh\approx \frac{\varepsilon_{\mathrm{mach}}|f|}{h}. Total E(h)h26f+εmachfhE(h) \approx \frac{h^2}{6}|f'''| + \frac{\varepsilon_{\mathrm{mach}}|f|}{h}. Setting dE/dh=0dE/dh = 0: h3f=εmachfh2h=(3εmachf/f)1/3105\frac{h}{3}|f'''| = \frac{\varepsilon_{\mathrm{mach}}|f|}{h^2} \Rightarrow h^* = (3\varepsilon_{\mathrm{mach}}|f|/|f'''|)^{1/3} \approx 10^{-5} for typical functions.

Complex-step: Im[f(x+ih)]/h\mathrm{Im}[f(x+ih)]/h involves no subtraction of similar quantities — the real and imaginary parts are stored in separate floating-point registers. Round-off error is O(εmach)O(\varepsilon_{\mathrm{mach}}) on the imaginary part directly. Taking h=10100h = 10^{-100} gives h2h^2 truncation error =102000= 10^{-200} \approx 0 — the derivative is computed to full machine precision.

L3. Explain the rationale for Adjoint Algorithmic Differentiation (AAD) and its cost advantage over bump-reval. For a Black-Scholes Monte Carlo pricer with 500 market inputs (a full vol surface), compare the cost of bump-reval, complex-step bump-reval, and AAD.

Bump-reval: 500 up-bumps + 500 down-bumps + 1 base = 1001 full Monte Carlo runs. If each run costs TfT_f, total cost: 1000Tf\sim 1000\,T_f.

Complex-step bump-reval: 500 complex repricings (each with complex arithmetic, roughly 2×Tf2\times T_f) = 1000Tf\sim 1000\,T_f. Same order but with better accuracy.

AAD: one forward pass (cost TfT_f) to evaluate the price, one backward pass (cost 35Tf\sim 3\text{–}5\,T_f) to propagate adjoints (reverse-mode automatic differentiation) — gives all 500 partial derivatives simultaneously. Total: 46Tf\sim 4\text{–}6\,T_f regardless of the number of inputs. Speedup over bump-reval: 200250×\sim 200\text{–}250\times for 500 inputs. For a book with 100,000 positions and end-of-day risk, the difference between hours and minutes.