{ι : Type u_1} → Finset ι → (ι → ℕ) → (ι → ℝ) → ℝ → ℝConvexity numerator: ∑ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2}.
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.
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.
convexityNumerator: the convexity numerator ∑ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2}.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)).bond convexity, second derivative of price, yield Taylor expansion, price–yield curve, coupon bond, interest rate sensitivity, MSC 91G30, JEL G12
Above: what it imports. Below: what imports it.
{ι : Type u_1} → Finset ι → (ι → ℕ) → (ι → ℝ) → ℝ → ℝConvexity numerator: ∑ t_i · (t_i + 1) · c_i / (1 + y)^{t_i + 2}.
∀ {ι : Type u_1} (s : Finset ι) (t : ι → ℕ) (c : ι → ℝ) {y : ℝ}, 1 + y ≠ 0 → HasDerivAt (fun y' => modifiedNumerator s t c y') (-convexityNumerator s t c y) yDerivative 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.
∀ {ι : Type u_1} (s : Finset ι) (t : ι → ℕ) (c : ι → ℝ) {y : ℝ}, 1 + y ≠ 0 → HasDerivAt (fun y' => -modifiedNumerator s t c y') (convexityNumerator s t c y) ySecond 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)².
∀ {ι : 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 yConvexity-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.