Integral Calculus and Differential Equations › Present Value and the Yield Curve

Michael BrenndoerferOctober 28, 20257 min read
Quantitative FinanceAll chapters
Part 1 of 15Mathematical Foundations
Chapter 7Integral Calculus and Differential Equations › Present Value and the Yield Curve
Reading section 5 of 14 · Present Value and the Yield Curve · 7 minSection 5 of 14 · 7 min

Book contents

Section 5 of 14 · 7 min read

Integral Calculus and Differential Equations › Present Value and the Yield CurveOne section · Sections in this chapter5 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

An important application of integration in finance is computing present values when interest rates vary over time. In the real world, interest rates are not constant. Short-term rates typically differ from long-term rates, creating a term structure that may be quoted as par yields, zero or spot rates, forward rates, or discount factors. The integration formula below applies directly to the instantaneous forward curve. A continuously compounded zero rate maps directly to a discount factor, while par yields must first be transformed into zero rates or forward rates.

A specified instantaneous forward curve determines the discount factors used in these cash-flow models. Slope alone does not determine a discount factor: the upward-sloping forward curve and flat curve below have identical ten-year discount factors, even though they differ at other maturities. The integral uses the full curve up to the chosen maturity.

Continuous Discounting with Time-Varying Rates

For a time-zero term structure, let f(0,t)f(0,t) denote the instantaneous forward rate for maturity tt. We can no longer apply e−rTe^{-rT} with one constant rate. Instead, the discount factor from time 00 to time TT integrates the forward curve across maturities:

D(0,T)=exp⁡(−∫0Tf(0,s) ds)D(0, T) = \exp\left( -\int_0^T f(0,s) \, ds \right)

where:

  • D(0,T)D(0, T): discount factor from time 00 to time TT
  • f(0,s)f(0,s): time-zero instantaneous forward rate for maturity ss
  • ss: dummy variable indexing maturity
  • ∫0Tf(0,s) ds\int_0^T f(0,s) \, ds: accumulated continuously compounded forward rates through maturity TT

The corresponding continuously compounded TT-maturity spot, or zero, rate is the maturity average

R(0,T)=−log⁡D(0,T)T=1T∫0Tf(0,s) ds.R(0,T)=-\frac{\log D(0,T)}{T}=\frac{1}{T}\int_0^T f(0,s)\,ds.

Thus an instantaneous forward rate, a maturity-specific spot rate, and a future short rate are distinct objects. The same exponential formula can integrate a deterministic future short-rate path, but such a path is a model assumption rather than the observed time-zero spot curve.

Discount Factor

The discount factor D(0,T)D(0, T) represents the present value of $1 to be received at time TT. For T>0T>0, a positive accumulated forward rate gives D(0,T)<1D(0,T)<1. At time zero the factor is one; negative accumulated rates can produce a factor above one.

Consider a time-zero instantaneous forward curve that starts at 3% and increases linearly to 5% at a 10-year maturity:

f(0,t)=0.03+0.002tf(0,t) = 0.03 + 0.002t

This is an illustrative upward-sloping term structure, not a causal account of why the curve slopes upward. The discount factor for a 10-year cash flow is:

D(0,10)=exp⁡(−∫010(0.03+0.002t) dt)D(0, 10) = \exp\left( -\int_0^{10} (0.03 + 0.002t) \, dt \right)

Computing the integral:

∫010(0.03+0.002t) dt=[0.03t+0.001t2]010=0.3+0.1=0.4\int_0^{10} (0.03 + 0.002t) \, dt = \left[ 0.03t + 0.001t^2 \right]_0^{10} = 0.3 + 0.1 = 0.4

Therefore:

D(0,10)=e−0.4≈0.6703D(0, 10) = e^{-0.4} \approx 0.6703

A cash flow of $1,000 in ten years has a present value of approximately $670.32. Its maturity-specific zero rate is R(0,10)=10−1∫010f(0,s) ds=4%R(0,10)=10^{-1}\int_0^{10}f(0,s)\,ds=4\%, so the flat-4% factor agrees exactly at this maturity: e−R(0,10)10=e−0.4e^{-R(0,10)10}=e^{-0.4}. This identity holds for any integrable forward curve; linearity makes the average easy to calculate. One maturity average does not determine discount factors at other maturities.

In[15]:
Code
import numpy as np
from scipy import integrate


def instantaneous_forward(t):
    """Time-zero forward curve: f(0,t) = 3% + 0.2% per year."""
    return 0.03 + 0.002 * t


def discount_factor(T):
    """Compute discount factor from 0 to T under time-varying rates."""
    integral, _ = integrate.quad(instantaneous_forward, 0, T)
    return np.exp(-integral)


# Calculate discount factors for various maturities
maturities = np.array([1, 2, 5, 10, 20, 30])
discount_factors = np.array([discount_factor(T) for T in maturities])
Out[16]:
Console
Discount Factors Under Upward-Sloping Yield Curve:
---------------------------------------------
Maturity (years)     Discount Factor PV of $1000    
---------------------------------------------
1                    0.969476        $969.48        
2                    0.938005        $938.00        
5                    0.839457        $839.46        
10                   0.670320        $670.32        
20                   0.367879        $367.88        
30                   0.165299        $165.30

The discount factors decrease with maturity because the accumulated rate increases. Relative to a flat 4% curve, the time-varying factor is higher for 0<T<100<T<10, equal at T=10T=10, and lower for T>10T>10; a global claim that its decline always accelerates would be incorrect.

Out[17]:
Visualization
Linear instantaneous forward curve increasing from 3% to 9%, with the zero rate increasing from 3% to 6%.
The instantaneous forward curve f(0,t) and its maturity-dependent zero-rate curve R(0,T).
Discount factors under f(0,t) = 3% + 0.2% times t and a flat 4% rate, crossing at the 10-year maturity.
Compared with a flat 4% curve, the time-varying discount factor is higher for maturities between 0 and 10 years, equal at 10 years, and lower after 10 years.

Pricing a Bond with Continuous Coupons

Consider a bond paying continuous coupon at rate cc per year on a principal of PP, maturing at time TT. Coupon bonds normally pay on discrete dates. A continuous-coupon stream is a simplifying model and can approximate a sufficiently frequent payment schedule when the coupon timing and discount curve are smooth. The present value combines the stream of coupons and the principal repayment:

PV=∫0Tc⋅P⋅D(0,t) dt+P⋅D(0,T)PV = \int_0^T c \cdot P \cdot D(0, t) \, dt + P \cdot D(0, T)

where:

  • PVPV: present value of the bond
  • cc: continuous coupon rate (per year)
  • PP: principal (face value)
  • TT: maturity time
  • D(0,t)D(0, t): discount factor from time 00 to time tt

The first term captures the present value of all coupon payments: at each instant tt, the bond pays c⋅Pc \cdot P per year, and this payment is discounted back to today using D(0,t)D(0, t). The second term is the present value of the principal repayment at maturity.

With our upward-sloping instantaneous forward curve:

In[18]:
Code
def bond_price(principal, coupon_rate, maturity):
    """Price a bond with continuous coupons under time-varying rates."""

    # Present value of coupon stream
    def coupon_pv_integrand(t):
        return coupon_rate * principal * discount_factor(t)

    coupon_pv, _ = integrate.quad(coupon_pv_integrand, 0, maturity)

    # Present value of principal
    principal_pv = principal * discount_factor(maturity)

    return coupon_pv + principal_pv


# Price a 10-year bond with 4% coupon
principal = 1000
coupon_rate = 0.04
maturity = 10

price = bond_price(principal, coupon_rate, maturity)
Out[19]:
Console
Bond Parameters:
  Principal: $1,000
  Coupon rate: 4.0%
  Maturity: 10 years

Bond Price: $1,005.54
  Coupon PV: $335.22
  Principal PV: $670.32

The bond is slightly above par, at about $1,005.54. Its cumulative average forward rate R(0,t)=0.03+0.001tR(0,t)=0.03+0.001t is below 4% for every 0<t<100<t<10, equaling 4% at maturity. Thus each earlier coupon has a larger discount factor than under the flat-4% continuous-coupon bond, while principal has the same factor. The instantaneous forward itself is below 4% only during the first five years.