The discount curve

DiscountCurve is the market input shared by every no-arbitrage and full-curve model. It stores pillar discount factors and interpolates the cumulative log-discount

\[Y(t) = -\ln P(0, t) = \int_0^t f(0, u)\, du\]

with a shape-preserving monotone cubic (PCHIP). Interpolating \(Y\) rather than zero rates or discount factors has two consequences:

  • If the input forwards are positive, \(Y\) is increasing and the interpolant preserves monotonicity, so discount factors stay positive and decreasing with no spline overshoot.

  • The instantaneous forward curve \(f(0, t) = Y'(t)\) is continuous (the interpolant is \(C^1\)), which matters because the no-arbitrage models consume \(f(0, t)\) directly.

Beyond the last pillar the curve extrapolates with a constant instantaneous forward, \(Y(t) = Y(t_{\max}) + f(0, t_{\max})(t - t_{\max})\).

Quantities

For maturities \(t\), \(t_1 < t_2\):

\[P(0, t) = e^{-Y(t)}, \qquad R(0, t) = \frac{Y(t)}{t}, \qquad f(0, t) = Y'(t)\]

and the simply-compounded forward over \([t_1, t_2]\):

\[F(0; t_1, t_2) = \frac{1}{t_2 - t_1}\left(\frac{P(0, t_1)}{P(0, t_2)} - 1\right)\]

At \(t = 0\) the zero rate is defined by its short-end limit \(R(0, 0) = f(0, 0)\).

Construction

import numpy as np
from interest_rate_models import DiscountCurve

# From discount factors
curve = DiscountCurve([1.0, 2.0, 5.0], [0.97, 0.935, 0.83])

# From continuously-compounded zero rates
curve = DiscountCurve.from_zero_rates([1.0, 2.0, 5.0], [0.030, 0.033, 0.037])

# Flat curve
curve = DiscountCurve.flat(0.03)

Discount factors above one are allowed (negative rates). Pillar times must be positive and strictly increasing.