MathFin
Map / Valuation · Interest rates / MathFin.Models.Rates.ConvexitySensitivity

Convexity as the second derivative of bond price (first-principles)

MathFin.Models.Rates.ConvexitySensitivityMSC 91G30JEL G12 source

For a coupon bond with discrete-compounded yield y and cashflows c_i at integer times t_i,

P(y) = Σ c_i / (1 + y)^{t_i}, P'(y) = −Σ t_i · c_i / (1 + y)^{t_i + 1} = −ModNum(y) (DurationSensitivity), P''(y) = Σ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2} =: ConvNum(y).

The convexity is C(y) := ConvNum(y) / P(y) — the percentage second derivative of price w.r.t. yield. Together with duration, it gives the standard discrete yield Taylor expansion

ΔP/P ≈ −D_mod · Δy + ½ C · (Δy)².

This file derives the second-derivative identity from the per-cashflow second derivative d²/dy² [c / (1+y)^n] = n · (n+1) · c / (1+y)^{n+2}, obtained by applying hasDerivAt_coupon_term from DurationSensitivity a second time.

Why this is "first principles"

Pre-existing Models.Rates.MacaulayModified defines duration numerators algebraically. Models.Rates.DurationSensitivity (phase 21) derives dP/dy = −ModNum. This file completes the discrete yield-Taylor expansion by deriving d²P/dy² = ConvNum — i.e., bond convexity is literally the second derivative of price, not a separately-defined moment.

Main definitions

  • convexityNumerator: the convexity numerator ∑ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2}.

Main results

  • hasDerivAt_modifiedNumerator: d/dy [ModNum(y)] = −ConvNum(y).
  • hasDerivAt_bondPriceDisc_secondDeriv: d²P/dy² = ConvNum(y) (stated as the derivative of P'(y) = −ModNum(y)).

Tags

bond convexity, second derivative of price, yield Taylor expansion, price–yield curve, coupon bond, interest rate sensitivity, MSC 91G30, JEL G12

Import neighbourhood

Above: what it imports. Below: what imports it.

Declarations 4

defMathFin.convexityNumeratorsource
{ι : Type u_1} → Finset ι → (ι → ℕ) → (ι → ℝ) → ℝ → ℝ

Convexity numerator: ∑ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2}.

theoremMathFin.hasDerivAt_modifiedNumeratorsource
∀ {ι : Type u_1} (s : Finset ι) (t : ι → ℕ) (c : ι → ℝ) {y : ℝ}, 1 + y ≠ 0 → HasDerivAt (fun y' => modifiedNumerator s t c y') (-convexityNumerator s t c y) y

Derivative of ModNum(y) is −ConvNum(y). Proof: for each term (t_i : ℝ) · c_i / (1 + y')^(t_i + 1), the derivative is

d/dy [(t_i : ℝ) · c_i / (1 + y')^(t_i + 1)] = (t_i : ℝ) · (−(t_i + 1) · c_i / (1 + y)^(t_i + 2)) = −(t_i : ℝ) · ((t_i : ℝ) + 1) · c_i / (1 + y)^(t_i + 2).

Summing over cashflows: d/dy ModNum = −ConvNum.

theoremMathFin.hasDerivAt_bondPriceDisc_secondDerivsource
∀ {ι : Type u_1} (s : Finset ι) (t : ι → ℕ) (c : ι → ℝ) {y : ℝ}, 1 + y ≠ 0 → HasDerivAt (fun y' => -modifiedNumerator s t c y') (convexityNumerator s t c y) y

Second derivative of bond price: P''(y) = ConvNum(y), stated as the derivative of P'(y) = −ModNum(y).

Combined with hasDerivAt_bondPriceDisc (from DurationSensitivity), this gives the full discrete yield Taylor expansion of the bond price:

P(y + Δy) ≈ P(y) − ModNum(y) · Δy + ½ · ConvNum(y) · (Δy)².

theoremMathFin.bondPriceDisc_secondDeriv_eq_convexity_times_pricesource
∀ {ι : Type u_1} (s : Finset ι) (t : ι → ℕ) (c : ι → ℝ) {y : ℝ}, 1 + y ≠ 0 → ∃ P'', HasDerivAt (fun y' => -modifiedNumerator s t c y') P'' y ∧ P'' / bondPriceDisc s t c y = convexityNumerator s t c y / bondPriceDisc s t c y

Convexity-sensitivity identity: P''(y)/P(y) = C(y) = ConvNum/P. The percentage second derivative of price equals convexity, completing the duration-convexity yield Taylor expansion.