TQBTHEQUANTBATEMAN
TQB/ learn/ rates/ curve interpolationEN · DARK
Rates & curves · advanced

Curve interpolation, extrapolation and arbitrage

Choosing the state to interpolate by controlling off-grid discount and forward behaviour

BY THE END, YOU CAN

01Compare linear-zero, log-linear-discount and monotone interpolation.

02Derive the forward curve implied by an interpolation rule.

03Detect negative discount factors, impossible accumulations and local forward spikes.

04Explain why interpolation is a risk-model choice between liquid pillars.

01
INTUITION

Identify the state variables and the behavior they add.

The market constrains a sparse set of instruments, but valuation asks for every date. Interpolation specifies the untraded economy between pillars and therefore changes cash-flow PV, carry and hedge allocation.

01

Interpolate a mathematically controlled state, not whichever quote is easiest to display.

02

Log-linear discounting preserves positive discount factors and gives piecewise-constant continuous forwards.

03

Smooth curves can still be economically unstable if their derivatives oscillate.

02
WHY MARKETS CARE

Ask which instruments can identify the dynamics.

Off-grid coupons, broken-date trades, forward starts and risk buckets all depend on interpolation and extrapolation beyond liquid tenors.

INSTRUMENTS

broken-date swaps

forward-start swaps

bonds

long-dated exotics

QUOTE CONVENTION

Record interpolation variable, order, boundary conditions, extrapolation policy and the liquid horizon with every curve build.

03
MATHEMATICS

Write the dynamics before interpreting parameters.

Formula · Short derivation

Log-linear discount

ℓ(T)=(1−w)ℓ(Ti)+wℓ(Ti+1)\ell(T)=(1-w)\ell(T_i)+w\ell(T_{i+1})

Linear interpolation in log discount guarantees a positive discount factor after exponentiation.

Open in Analytics
Formula · Short derivation

Segment forward

fi=−ℓ(Ti+1)−ℓ(Ti)Ti+1−Tif_i=-\frac{\ell(T_{i+1})-\ell(T_i)}{T_{i+1}-T_i}

Log-linear discounting implies one constant continuous forward on each segment.

Open in Analytics
Short derivation
Short derivation

From log-discount interpolation to a segment forward

Differentiate the state actually interpolated, then inspect the economic quantity used by forward-start products.

  1. 01

    Choose log discount as state

    Write ℓ_i=ln P_i at each positive discount pillar.

  2. 02

    Interpolate linearly

    Between T_i and T_{i+1}, ℓ has a constant slope.

    ℓ(T)=ℓi+T−TiTi+1−Ti(ℓi+1−ℓi)\ell(T)=\ell_i+\frac{T-T_i}{T_{i+1}-T_i}(\ell_{i+1}-\ell_i)
  3. 03

    Differentiate

    The negative derivative of ℓ is the instantaneous forward and is constant on the segment.

    fi=−(ℓi+1−ℓi)/(Ti+1−Ti)f_i=-(\ell_{i+1}-\ell_i)/(T_{i+1}-T_i)
  4. 04

    Reintegrate

    Integrating the segment forwards reproduces every input pillar exactly.

  5. 05

    Stress the boundaries

    Inspect discontinuities in forwards at nodes and compare extrapolated PV/risk outside the last liquid tenor.

Interpolation selects off-grid forwards and risk allocation; it belongs in model governance, not chart styling.

Inputs
  • \ell(T)=\ln P(0,T): log discount
  • f(0,T)=-\ell'(T): instantaneous forward
  • T_i: liquid pillars
  • w(T): interpolation weight
Assumptions and limits
  • Piecewise-constant forwards jump at pillars.
  • Higher-order splines can overshoot or create oscillating forwards.
  • Any extrapolation beyond the liquid horizon is a model assumption.
Formula · Short derivation

Reconstruction identity

P(0,T)=exp⁡(−∫0Tf(0,u) du)P(0,T)=\exp\left(-\int_0^T f(0,u)\,du\right)

Any interpolated forward representation must integrate back to the discount curve.

Open in Analytics
05
MODEL / PRICING

Calibrate, compute, and challenge the dynamics.

METHOD

Interpolate one controlled state, expose derived zero/forward/discount views, and run node-reconstruction plus off-grid perturbation tests.

CALIBRATION

Choose the rule by product needs, hedge stability and historical robustness—not in-sample curve smoothness alone.

Implementation with current QuantLib

Select curve traits and interpolation deliberately—Discount/LogLinear, Zero/Linear or Forward variants imply different off-grid dynamics. Lock the policy in regression tests with discounts, forwards and instrument NPVs.

API authority: upstream QuantLib reference pinned in the source registry.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
ARCHITECTURE
  • Keep market conventions and quote lineage at the boundary.
  • Solve curves and dynamics in framework-free deterministic kernels.
  • Return residuals, state and sensitivities with every value.
  • Test analytical limits, reconstruction identities and failure domains.
PYTHON 3 · NUMPY / SCIPY

Log-linear discount interpolation

Preserve node discounts and verify a constant segment forward.

REUSABLE EXAMPLE
01from __future__ import annotations
02
03import math
04
05def log_linear(t: float, t0: float, p0: float, t1: float, p1: float) -> float:
06 if not (0 < t0 < t1 and t0 <= t <= t1 and p0 > 0 and p1 > 0):
07 raise ValueError("invalid interpolation domain")
08 w = (t - t0) / (t1 - t0)
09 return math.exp(math.log(p0) + w * (math.log(p1) - math.log(p0)))
10
11p1, p3 = math.exp(-0.02), math.exp(-0.03 * 3.0)
12p2 = log_linear(2.0, 1.0, p1, 3.0, p3)
13assert abs(math.log(p1 / p2) - math.log(p2 / p3)) < 1e-12
14assert log_linear(1.0, 1.0, p1, 3.0, p3) == p1
15print(f"P2={p2:.9f}")
EXPECTED OUTPUTAn interior discount factor with equal one-year continuous forwards on both halves.
SANITY CHECKS

✓ Input discounts remain positive.

✓ Pillar values are reconstructed.

✓ Segment-forward identity holds.

07
INTERACTIVE LAB

Shock one parameter and trace the full response.

OFF-GRID FORWARD STABILITY

Interpolation stress laboratory

Compare linear-zero, log-linear-discount and monotone shapes; expose their forward and off-grid PV consequences.

SYNTHETIC · CONTROLLED SCENARIOS
Max forward gap33.1 bp
Minimum forward1.51%
Boundary stateClean pillars
Instantaneous forward by Maturity (years)

Clean pillars: Methods remain controlled.

  • log-linear discount
  • monotone smooth
Maturity (years): 0.1Y. log-linear discount: 1.836%. monotone smooth: 1.505%.

Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.

ACTIVE STATE

Clean pillars — Methods remain controlled. Move the control and inspect every series with pointer or touch.

08
FRONT OFFICE

Where the model meets the book.

ON THE DESK
“The interpolation rule is where a sparse market becomes a dense risk model.”
VISIBLE INPUTS

curve pillars

interpolated state

boundary conditions

liquid horizon

product cash-flow dates

CALIBRATION

Reprice pillars identically, then choose among candidates using forward stability, hedge stability and out-of-sample broken-date behaviour.

RISK

off-grid DV01

node allocation

forward discontinuity

extrapolation

DAILY WORKFLOW
  1. fit same pillars
  2. derive forwards
  3. stress nodes
  4. compare broken dates
  5. approve one governed rule
Production failure modes
  • spline overshoot
  • hidden extrapolation
  • negative discount output
  • risk jumps after library upgrade
09MACRO CONNECTIONOpen the transmission channel.
MACRO CONNECTION

Interpolation and the shape of priced expectations

Markets quote a few tenors; interpolation controls how a macro move is distributed between them and therefore how slope or butterfly risk appears.

01Macro movetransmits

reprices liquid pillars

02Interpolationtransmits

fills unquoted dates

03Forward shapetransmits

allocates local expectations

04Hedge mapoutput

assigns risk to instruments

10COMMON PITFALLSOpen the failure checklist.
01

Choosing interpolation for visual smoothness only.

02

Inspecting zero rates without instantaneous forwards.

03

Assuming exact pillar fit means identical off-grid PV.

04

Extrapolating silently beyond market liquidity.

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

Curve construction, multi-curve, short-rate and HJM lectures

Research map for term-structure theory and numerical experiments; all platform explanations and code are original.

Source
Financial Engineering: Interest Rates & xVA
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗
research

Monte Carlo, stochastic calculus and calibration lectures

Mathematical and numerical cross-reference for model dynamics and diagnostics.

Source
Computational Finance Course
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗
implementation reference

Current bootstrapping, interpolation, curve, model, cap/floor and swaption tests

Implementation authority for production object boundaries and regression-test patterns.

Source
QuantLib upstream
Author
QuantLib contributors
Ref
v1.42.1
OPEN ORIGINAL SOURCE ↗